Reporting Services in visual studio 2010 - c#

I am creating an rdlc report in VS 2010 .
When I see my report in reportviewer it seems OK to me but when i export that report to PDF its format changes and reportviewer format do not match with PDF format....
I want to have same format in report
How can i resolve this problem....

This is a bit difficult to answer without knowing exactly what changes but I would assume this is down to page widths etc as thats one of the most common issues I've seen.
Your PDF is going to render the data in pages to fit on whatever the default is, probably A4 for uk or I believe Letter for USA, so the best way to get consistent results is to set the page size of your report to whatever size you are going to be printing it out on, and have fixed sizes, do not let things resize on their own.
If you want to update your answer with what is changing I can possibly help you more.

Related

Show formatted WYSIWYG field in Crystal Report

I am working on an application where it is necessary that the text that a user enters be formatted, be it bold, italic, point forms etc. For this reason I have elected to use a https://summernote.org/
Everything is fine and gets saved to my database. The problem is, when pulling up a crystal reports I am unsure how to do that without pulling in the tags and basically raw information that is in the database.
I've seen various links such as this on How can I represent data in a WYSIWYG format without using Crystal Reports?
That seems to suggest it can be done however I am not seeing where or what im supposed to change to get it ton work correctly.
Would be greatful if someone could point it out for me
Right-click the field, Format Field...
Select Paragraph tab
Set Text Interpretation to 'HTML Text'.
This would handle basic HTML formatting. For more advanced HTML scenarios, there's a solution via a UFL (user function library).

Exporting crystal reports to pdf with size smaller than A4

I'm trying to export a Crystal Report to PDF (or .doc or something else that Crystal Reports support) and then put it in my file system with a size smaller than A4. This is being done through Visual Studio 2010. I want to do this because the report has an image that is not that big and thus creating an A4 page with that small image would be ugly. If the size could be A5 or something similar, that would be great.
Thank you in advance,
Rafael Valente
So, i couldn't solve this issue with Crytal Reports after spending almost 2 days looking for a solution. Then i started to look for other reporting solutions, like SSRS. In Visual Studio, we can actually create a report with a .rdlc format (Add --> New Item --> Reporting --> Report). This format allows you to work with Report Viewer through VS and do the workaround to export succesfully to PDF (or other reading/writting format like .doc) or even an image.
This is my code:
I hope this is helpfull and can prevent other people for going crazy with things like this.
Best regards,
Rafael Valente
EDIT: This code is written in a normal class in VS. If you're using a .apsx item, then you can change the code and try to work with HTTP Response collection.

Print Mathematical equation in Winform | Report

I want to show Mathematical formula in Report in my winform application. I am aware about RDLC but during my testing I found I was not able to show it correctly (As per understanding, please let me know if I missed something). I also tried setting Placeholder property in RDLC to HTML - Interpret html tags as styles, but in vain.
eg. While showing x a [x^a] I got is showing xa [showing side by side]
How can I be able to show this kind of mathematical formula in RDLC report. or can anyone suggest any good reporting service by which I can achieve this.
Thanks in anticipation.
I think the easiest/best/reliable solution would be to save Math formula's to image and include the images in the Report:
Online tool for generating mathematical equation image files
This is How to show images on an RDLC report
I use Roger's Online Equation Editor.
PNG, colors, transparent background and anti-aliasing are all included.
And used Converting math equations to C# for inline code math equations

Can Crystal Reports Scale to Fit Page

Can a crystal report be scaled to fit page?
I'm hoping to achieve something similar to Microsoft Excel's Scale To Fit feature wherein a large spreadsheet can be scaled to fit a 8.5"x 11" page.
(On MS Excel 2007 goto Page Layout > Scale To Fit).
Im searching of a way to make a large report fit into a smaller page during print.
for example a report designed in Legal(8.5"x 14") page must be able to shrink when print
previewed for Letter(8.5"x 11") page.
In my crystal report, it should be scaled to fit the page by default.
I was thinking maybe theres a Crystal Report Setting or C# code technique that I missed out.
Any hint or link to the right direction is appreciated.
Thanks!
If you change the paper size programmatically, you will lose some of the canvas (hence fields).
Moreover, I'm not aware of any native API calls to scale the report as you request.
Workarounds:
print the report to PDF. In my experience, the Acrobat viewer will automatically scale the document to 8.5" x 11". Take a look at the article I wrote about correcting the automatic scaling: Adobe Acrobat – Printing Legal Landscape Documents
export the report to Excel, then use its shrink-to-fit option.
create a custom printer driver (akin to MS XPS image writer) to scale the image before printing--clearly not an easy task

Can Crystal Reports be edited in a .Net Windows interface?

I am currently evaluating Crystal Reports 2008 for use within a major enterprise project. I have successfully used Crystal Reports Basic within Visual Studio, but we want more functionality. Can these reports be edited in a .Net Windows interface?
Reports will be produced based on ADO.NET Xml datasets and will be saved to a SQL Server db as blobs of the rpt files. We will be retrieving these rpt files for viewing within a .Net Windows application coded using Visual Studio 2008 in C#.
I need to produce letters that hide and show sections/paragraphs based on formulae, but the users want to be able to edit the text.
Once a report has been created and is being displayed within the .Net CrystalReportViewer control (inside a .Net Windows application), is there any way I could permit the user to alter the displayed text and re-save the rpt file?
I know that I can use parameters, but it's not ideal for large paragraphs of text which may include some words in bold for example. The users are only likely to be changing a few words, such as the addressee of the letter. They have insisted that they need to be able to change anything on the letter.
I also know that (with Crystal XI or 2008) I can export to EditableRTF which does not put the text in frames like the standard RichTextFormat export option. The .Net RichTextBox component does not show headers or footers, which is a pain. I can show the RTFs in Word (even though they miss out lines and boxes from the report, but that's another matter) but quite frankly I'm terrified of the stories of deploying Office interop components in .Net apps.
When Crystal displays a report in preview mode you can click on pararaphs and it knows that there is a 'field' there because it highlights the row(s) with a box. Is there any way we can just edit this text and save the report again?
I'm under pressure to produce an estimate for this area of work. Is it possible within Crystal?
You've got a really good handle on the capabilities of Crystal, and you're right - the idea of editing big chunks of report text "live" is going to be tough.
The "export to RTF" option might be workable, provided you can live with one-way generation (after you use Crystal to generate the report and start editing the output, you can't re-generate without losing your edits).
Have you considered something like OneNote or other XSLT-based solutions? It seems like your users want a lot of control over the generated output, so your design's going to have to factor that in. Maybe even generate output and then shoot it straight into a document management system so users' changes are tracked and controlled?

Categories

Resources