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
Solved

VB.Net 2008, Creating PDF Files

Posted on 2013-06-26
9
388 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
  • 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 100

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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 100

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 250 total points
ID: 39278602
reinstall crystal on the pc
0
 
LVL 18

Assisted Solution

by:vasto
vasto earned 250 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 100

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

839 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