Exporting Gridview to PDF using ITextSharp with formatting - c#

I am trying to export a beautifully designed gridview to pdf using itextsharp. The export works fine, but it only export the content of the cells. No Lines to show its a table, no background colour etc. Please How do i export such that it carries gridview as viewed in C#

Related

Add watermark text to Excel document

I'm using OpenXML to generate Excel file.
I want to add watermark text to the Excel sheet using OpenXML.
How I can do this using OpenXML?
As word document watermark there is no such feature in Microsoft excel. But it can be mimic by applying Header, Footer or background image.
Please refer below link for adding background image in E
Add background image to Excel using OpenXML

Report Viewer Export to PDF (ASP.NET)

I have report viewer in asp.net project with C#.
I see the report good in Chrome, and in the toolbar I have option to export it to:
pdf /word / excel.
export to word and excel work good, but when I export it to PDF, it's seperate the report to 3 diffrent pages. (altough it's enter in 1 page)
How can I fix that? and export it to one PDF page . (like the word)
(I attach picture to show the diffrents:
http://oi61.tinypic.com/mvgayw.jpg
)
You need to check the Report page orientation and your page and body margins to ensure they fit in the page size you are using.
Please refer to this previous answer for details:
How to get rid of blank pages in PDF exported from SSRS

C# - How to: Open PDF, highlight search-results, and save highlighting back to PDF

I'm using itextsharp.dll.
How do I search and highlight text in the pdf file?
After highlighting the text in pdf, I want to save the highlighted pdf file such that when the PDF is re-opened, it is still highlighted.
Any ideas?
Have you consider another library such as Apache PDFBox? It is support following features:
PDF to text extraction
Merge PDF Documents
PDF Document
Encryption/Decryption
Lucene Search Engine Integration
Fill in form data FDF and XFDF
Create a PDF from a text file
Create images from PDF pages Print a PDF

Formatting of data exported to excel file

I have exported data from a text file to an excel sheet,
with the help of clipboard copy and paste.
I used PIA for this.
The exporting is done properly and the data is exported to a single column i.e in the A Column.
I want to fill my data in the rows of this column ,so that they are filled properly in the cell and I dont have to expand the A column to view complete data.
And also how can i change the font of the sheet while exporting
How is this text file created? If you have full control over its contents, I suggest using a csv ( comma-seperated-value ) file instead. You won't have control over the default font excel uses but it would fulfill your requirement of having the data populate multiple columns.
Outside of using csv file to handle this data, I suggest you look into exporting it into an excel document directly, you would have full control over look and the font used for the contents.

Formatting Issues with Excel Interop using C#

I have a C# application that uses an existing Excel spreadsheet as a template and fills in data. In the template there is a blank row that has some style formatting such as font/border and data formatting such as currency and percentages. When filling in the data from the application I copy this row n times and fill in the data. The style formatting works but as far as the data formatting it doesn't apply until I open up the spreadsheet click on the column then off of it. Does this have something to do with Excel interpreting the values as just string data and not being able to format it? Am I stuck with having to do my data formatting in the application?
You could try explicitly formatting each row after populating it. Is this Excel 2003 or 2007?

Categories