0

After googling about print a generated report by Crystal Report on an ASP.NET page, I found out this stuff is impossible ,because doing some thing like that means print a page on the server and this is subnormal , because the user want its print on its client, so here is some questions :

  1. Correct me please , am I wrong ?(I meant is it possible to print it on the client?)

  2. Before using the crystal report ,I have generated my reports in Stimulsoft. When the user click on the print button on the page , Stimul report posts back the page and after reloading , the print dialog opens and start to print.How to do something like this by crystal report

  3. If it is impossible ,so what is the advantage of crystal report on the web when user can not print it?!

  4. I think the best way is to create an excel export and force it to download on the client, is it true ?

If anybody have an idea i will glad to know it , even a small one. Sorry about bad English syntax(I am new in English). For more details comment me, I will update my question.

Regards

Raúl Roa
  • 12,061
  • 13
  • 49
  • 64
Ali Foroughi
  • 4,540
  • 7
  • 42
  • 66
  • You can directly export the Crystal Report to PDF/DOC/XLS this is as good as printing them. You can research on creating PDF from crystal report. If you still have problems i can help you. I have done that in many of my projects. – Ankit Sep 24 '12 at 14:03
  • @Ankit, Yes, you are right , but I want to print it directly to local printer(as same as stimulsoft do this) – Ali Foroughi Sep 24 '12 at 14:05
  • There is a workaround in my mind but i have not done this before. You can export it to HTML Page and you and use javascript to print it directly to the printer. – Ankit Sep 24 '12 at 14:37
  • @Ankit, after checking stimulsoft I found out that it does it as like as you said. It generates an html and the load it into an iframe, So I decide to do this , but the html export of Crystal report has diffidence with what it show in it viewer and it prints like html print.It is not suitable for a web site – Ali Foroughi Sep 24 '12 at 15:14
  • 1
    You can always configure style, fonts, images etc of the HTML before putting it in a iframe. You can also hide any TextBoxes/Buttons (if any) before printing the document. – Ankit Sep 24 '12 at 15:23
  • @Ankit , Yes I know , but this takes too long time to design every report , I am looking for better solution – Ali Foroughi Sep 24 '12 at 16:02

3 Answers3

1

you could convert it to pdf, then the user can print or save it from the client machine.

hagensoft
  • 1,497
  • 13
  • 13
  • As I mentioned in my question I am searching for print like Stimulsoft by crystal report, but one up vote for your correct answer, thanks dude – Ali Foroughi Sep 09 '12 at 05:46
0

After check my app on another system , I found out that because I install a PDF printer on mu system , when I click on the print button , crystal report start to export my report as a PDF document, So I think, Crystal report is acting like StimulSoft too , and showing that export dialog is depend to client print options , so my problem has been solve from the first and just have problem on my client. :D

Ali Foroughi
  • 4,540
  • 7
  • 42
  • 66
0

I assume that you have aspx page where this crystal report is displayed along with other components of the website like header, footer and menu etc. And you would like to print only the crystal report not the entire page. Please correct me if my assumption is incorrect.

But with the above assumption, you can use javascript to open a new browser window with only the crystal report (no post back required) and trigger the print function in the new window. You can copy the crystal report to the new window using a technique described in the following link:

Appending same node in different windows

Community
  • 1
  • 1
Vibgy
  • 303
  • 3
  • 9