For Programmers: Free Programming Magazines  


Home > Archive > ASP > November 2005 > What is wrong with this???









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author What is wrong with this???
jaloplo@gmail.com

2005-11-24, 7:55 am

Hi,

I have an application that was moved to other server. Before the
changed, It works properly, but now, there is an error when it creates
a Crystal Report.

I would like to know if this code is correct or has something wrong or
not correct at all.

'------------------------------------------------------------------------------------------

Public Function GenerarInformePdf() As Stream
Dim client As ReportClientDocument
Dim miStream As Stream

On Error GoTo controlError

Set client = DameInforme()

Set miStream = New Stream

miStream.Open
miStream.Type = adTypeBinary
miStream.Write
client.PrintOutputController.Export(crReportExportFormatPDF,
0).ByteArray
miStream.Position = 0

Set GenerarInformePdf = miStream
Set miStream = Nothing

Exit Function
controlError:

Set GenerarInformePdf = Nothing
End Function

'------------------------------------------------------------------------------------------


I'm not able to know the error it produces, because the function is in
a dll file.


Thanks in advance!!!!

Mark Schupp

2005-11-25, 6:55 pm

Is the code you are showing from the DLL? If not then I'm guessing you code
is ASP.NET. You'll need to check a .net group.

If the code is in a DLL then you need to modify the dll to report errors
when it encounters then instead of just exiting (either raise the error
again after cleaning up or write it to a log file).

--
--Mark Schupp


<jaloplo@gmail.com> wrote in message
news:1132826562.962696.83430@g49g2000cwa.googlegroups.com...
> Hi,
>
> I have an application that was moved to other server. Before the
> changed, It works properly, but now, there is an error when it creates
> a Crystal Report.
>
> I would like to know if this code is correct or has something wrong or
> not correct at all.
>
> '------------------------------------------------------------------------------------------
>
> Public Function GenerarInformePdf() As Stream
> Dim client As ReportClientDocument
> Dim miStream As Stream
>
> On Error GoTo controlError
>
> Set client = DameInforme()
>
> Set miStream = New Stream
>
> miStream.Open
> miStream.Type = adTypeBinary
> miStream.Write
> client.PrintOutputController.Export(crReportExportFormatPDF,
> 0).ByteArray
> miStream.Position = 0
>
> Set GenerarInformePdf = miStream
> Set miStream = Nothing
>
> Exit Function
> controlError:
>
> Set GenerarInformePdf = Nothing
> End Function
>
> '------------------------------------------------------------------------------------------
>
>
> I'm not able to know the error it produces, because the function is in
> a dll file.
>
>
> Thanks in advance!!!!
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com