I would like to be able to export only the first page of an XtraReport to text. I can see how to do it when exporting to HTML (or various other formats) using the exportoptions. I can't see any way to do it when exporting to text though.
Any ideas?
Answer from DevExpress:
Thank you for contacting us. To accomplish this task, you can use the
Page Merging technique. Refer to the How to: Merge Pages of Two
Reports article for additional information. See the code below:
[VB.NET]
Dim report As New XtraReport1()
report.CreateDocument()
Dim ps As New PrintingSystem()
ps.Pages.Add(report.Pages(0))
ps.ExportToText(file)
It worked perfectly.
Related
I need a function to convert any HTML table to a excel file!
I like to add a button to my page and once that button is clicked I pass a complete HTML table in to such a function that will generate an excel file and past the html table into the file with the same layout and design!
I appreciate any help with this request.
I am using c# and asp.net
This is a nasty trick, but it works in recent version of excel.
You just save the html table as a normal html file, then just rename it to xls. If your application is a web application use response.setHeader("Content-Disposition", "attachment; filename=order.xls").
Recent version of excel support Microsoft Office XML Formats, so if the previous solution doesn't work, you may want to try to generate the xml from the html table.
See XML Spreadsheet Reference.
What I do, is to generate the xml from excel in the xml format, then hack into it. You can implement also advanced features like automatic filters, and cool layouts. I used a template engine to generate the xml (Freemarker, it's Java stuff, but I'm sure there are template engines also for .NET)
I am retrieving an XML document from a web service (UPS actually), and I can pull the information I need from the XML, but I can't get the XML to display in the XML format. I can get it to display in a label and literal, but its all ran together. The nodes aren't displaying. The nodes display in a text box control, but it still runs together (no brks)
Any idea how to take the XML document that i get from the service and display it just like it would if you open up an XML doc in IE?
Thanks
BTW... i have search all day for this and the only thing i could find is if i was displaying a static file, which i'm not. I also tried doing the stringbuilder/stringwriter, but no luck. I'm still pretty new at this stuff so i could be missing something.
HELP... PLEASE!
Try encompassing the XML in the
<pre>... your xml</pre>
tags.
I want to export a few Pages to pdf/xls. By Pages I mean as the eye sees it - a screenshot of the Page's contents. I know how to build pdf/xls documents using 3rd party tools but is there any way to quickly export the rendered contents of say a Panel?
edit: maybe a tool that can render the page's output as a browser would, and save it as an image file?
There is an open source console program named wkhtmltopdf which you could call from asp.net to convert the page. It can convert to PDF or an image with wkhtmltoimage (JPG, PNG, etc.) using the webkit rendering engine.
Check my answer to this question to see an example of how to convert from a html to a pdf using C#:
Easiest way of porting html table data to readable document
I can recommend http://www.screengrab.org/ for firefox.
can any one help me
i wan to generate report (RDLC) by using following template ...
Dear [Name],
you are able to generate this later. Kindly consider this.
<b>Regards</b>
<span style="color:blue">[CompanyName]</span>
[Address]-[City]
This is Dynamic template that Administrator can change it any time.. so i need to apply this dynamically that how can i add HTML in RDLC however [Name],[CompanyName],... that can be replace by me easily.. but i dnt knw hot i add HTML into RDLC.. ??
plz help me
Thanks in advance...
Add to your report one Label for every TAG, add in the value field a placeholder, like ="$CITY$"
When you process the RDLC report read it from the filesystem, find the placeholder and replace with the current value.
Reload the RDL xml into the reportViewer and execute the report.
More details on this post for details on how to dynamically modify reports stack overflow article
I have been searched alot on google about HTML Formating in RDLC but couldn't find any proper answer.
I got one idea to render html tag in rdlc while you export locally in pdf.
Use below expression in textbox :-
=Replace(Replace(Replace(Replace(Fields!your column name*.Value,""",""""),"&","&"),"<","<"),">",">")
" replaced by "(Quotes)
& replaced by &
< replaced by <
> Replaced by >
so if you want replaced any more special charachter then just add more in above expression and it will take care of that.
I have taken care almost special charachters so whenever you export these in pdf they would be well formated as html tags.
If you still find any problem then let me know.
Thanks
Mahendra Singh
I have designed one web page in asp.net. In that i have used the css file and excel generation button. While i am cliking the button for populating the data from database to excel. It is showing the problem in uploading the css file like that .What will i do the for removing the that error.
For opening the excel sheet I have used the following code that is
Response.ContentType = "application/xls";
Response.AddHeader("Content-Disposition", "attachment; filename=itext.xls");
Is there anything wrong in this?
If I understood correctly, the problem you're having is one I had a long time ago (still in the classic ASP days) where you get an error "missing file" pointing to the css reference when you open the excel file you generated. The workaround I've done at the time was to remove the css reference completely and use inline styles instead.
That will allow you to go home, but if you want a more evolved solution you could make an async request to the server, generate the content there (either in-memory or in a file, depending how big the result is) and then send it back to the client when it's done.