?
Solved

VB.Net 2008, Creating PDF Files

Posted on 2013-06-26
9
Medium Priority
?
391 Views
Last Modified: 2013-07-05
Good Morning,

 I have a sub routine that creates a pdf file of a report that was created using Crystal Reports 2008.  I'm doing the following:

rptDoc.ExportToDisk(ExportFormatType.PortableDocFormat, g_strPDFPath & "\" & strFileName & "" & ".pdf")

The Issue:  Only on 2 machines (out of 40) do I have this issue.  Whenever they run this piece of code, they get an error that says <application name> has encountered a probelm and needs to close.  We are sorry for the inconvenience.

This only happens whne creating the PDF file.  I've tried commented out the displaying of the crystal report and just creating the pdf, that failed.  I tried commenting out the PDF and just displaying the crystal reprot and that worked.  I don't see why the above code is causing the issue.  Has anyone experienced this before??

Thanks,

Jim
0
Comment
Question by:transstates
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 39278288
can u wrap with try/catch when calling ExportToDisk?
the exception will tell you where the problem is.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 39278342
What are the differences on the 2 machines?

I assume the PDF export modules are installed on them?

mlmcc
0
 

Author Comment

by:transstates
ID: 39278454
When putting it in a try catch, it appearently gets to the .ExportToDisk and they bombs and never logs a message.  It a hard crash that exits the program and takes the user back to the desktop.

I changed it up a little....

Try

                Dim strFileName As String = "Remove" & " - " & cboPartNumber.Text
                With reportDocument1
                    .Load(g_strAssemblyChange) 'Path of the report
                    .ExportToDisk(ExportFormatType.PortableDocFormat, g_strPDFPath & "\" & strFileName & "" & ".pdf")
                End With

            Catch ex As Exception
                g_strCode = "ERR"
                g_strMessage = ex.Message.ToString()
                Call WriteErr(g_strCode, "Form1", "Printeport()", g_strMessage, "", ex.Message, 0)
                MsgBox("error has been written")
            End Try
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 101

Expert Comment

by:mlmcc
ID: 39278519
Have you tried other export types like Excel or Word?

mlmcc
0
 
LVL 15

Accepted Solution

by:
Ess Kay earned 1000 total points
ID: 39278602
reinstall crystal on the pc
0
 
LVL 18

Assisted Solution

by:vasto
vasto earned 1000 total points
ID: 39278743
I guess the problem is not in your code. Try to show the report in a viewer ( on screen) and export to PDF from the viewer. If it fails again then you probably need to take time to fix Crystal runtime on these machines
0
 

Author Comment

by:transstates
ID: 39278841
I will try to reinstall crystal.  This may take a bit, I have to wait for the user(s) to be gone or at a break point.  I will respond as soon as I can.  Thank you all!!
0
 
LVL 18

Expert Comment

by:vasto
ID: 39278920
Try first to export from the viewer.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 39278987
Crystal isn't installed on a client.  

Is this running as a thick or thin client application?

mlmcc
0

Featured Post

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question