Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Can't export my report as PDF Post Reply Post New Topic
Author Message
WolfgangS
Newbie
Newbie


Joined: 20 Mar 2009
Online Status: Offline
Posts: 2
Quote WolfgangS Replybullet Topic: Can't export my report as PDF
    Posted: 20 Mar 2009 at 5:13am
Hi,
 I can show my report successfully and want to export it to a pdf file.

  • After rightclick on the report->export->(Format:Adobe PDF, Destination: Disk File) -> OK -> OK happends nothing.

  • Same when I click on the export button (.EnableExportButton = True)


This happends with the CR object for 8.5 and 10.
I even tried a report file without any parameters (differs form the source below)


any help would be very appreciated ... Cry


MfG
 WolfgangS



this is my code:

Private Sub Form_Load()
 
  Dim objActReport As CRAXDRT.Report
  Dim objApplication As CRAXDRT.Application
  Dim objRst As ADODB.Recordset

  Set objApplication = New CRAXDRT.Application
  Set objActReport = New CRAXDRT.Report
  Set objRst = New ADODB.Recordset

  Set objActReport = objApplication.OpenReport("C:\Program Files\CodeCheckerWorld\RPT_HANS.rpt")

  Call objActReport.DiscardSavedData

  With objActReport
    .ReportTitle = "CodeChecker 4 - accepted  hints"
    .ParameterFields.GetItemByName("Username").AddCurrentValue "zzz"
    .ParameterFields.GetItemByName("SWVersion").AddCurrentValue "yyyy
    .ParameterFields.GetItemByName("ReportSubTitle").AddCurrentValue "xxxx"
    Call .Database.SetDataSource(objRst, 3, 1)
  End With

  With CrystalActiveXReportViewer1
    .EnableExportButton = True
    .ReportSource = objActReport           ' pass the hints
    .ViewReport                            ' call it
  End With
 
End Sub

IP IP Logged
shortduck
Newbie
Newbie


Joined: 17 Mar 2009
Online Status: Offline
Posts: 13
Quote shortduck Replybullet Posted: 20 Mar 2009 at 6:13am
Hi this is what i am using
 
I have two version and both of them are working;
 
a] with RAS
 

CrystalDecisions.ReportAppServer.CommonObjectModel.ByteArray myBytes;

// Now export as PDF

myBytes = rptClientDoc.PrintOutputController.Export(CrystalDecisions.ReportAppServer.ReportDefModel.CrReportExportFormatEnum.crReportExportFormatPDF, 0);

HttpContext.Current.Response.Clear();

HttpContext.Current.Response.AddHeader("content-disposition", "inline,filename=untitled.pdf");

HttpContext.Current.Response.ContentType = "application/pdf";

HttpContext.Current.Response.BinaryWrite(myBytes.ByteArray);

the std way:

HttpContext.Current.Response.Buffer = false;

HttpContext.Current.Response.Clear();

HttpContext.Current.Response.ClearContent();

HttpContext.Current.Response.ClearHeaders();

rpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat, HttpContext.Current.Response, false, "Report");

 rpt.Close();

 rpt.Dispose();

IP IP Logged
WolfgangS
Newbie
Newbie


Joined: 20 Mar 2009
Online Status: Offline
Posts: 2
Quote WolfgangS Replybullet Posted: 20 Mar 2009 at 6:24am
Hi,
 thank you for your answer.

I had to change buggy Crystal Reports dlls with newer ones.
Unfortunately I couldn't couldn't figure out how because it wasn't able to
register the newer ones, so I installed CR8.5, installed SP3 and tadaaa ...
it worked fine.

The key to find the solution was ErrorCode 80047784 which appears
when I force an export by code.

thank you anyway :)

Wolfgangs


IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.