This is a migrated thread and some comments may be shown as answers.

Report Export problem

5 Answers 170 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Benson
Top achievements
Rank 1
Benson asked on 29 May 2007, 10:13 AM
Support,
I am going to export Telerik Report into pdf file, and then open it in the browser. The following is what my codes:

        Dim report As New Report1()
        Dim mimetype As String = String.Empty
        Dim extension As String = String.Empty
        Dim encode As Encoding = Nothing
        Dim buffer As Byte() = ReportProcessor.Render("PDF", report, Nothing, mimetype, extension, encode)
        Dim fs As New IO.FileStream("C:\temp\a.pdf", IO.FileMode.Create)
        fs.Write(buffer, 0, buffer.Length)
        fs.Flush()
        fs.Close()

Result:
1. On the line (Dim buffer...), error "Use the "new" keyword to create an object instance", please help.
2. How do I open the pdf file in browser or RadWindows? (I am not good in javascript and my application must use the pdf temp file rather than direct showing pdf in browser)

Benson.

5 Answers, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 29 May 2007, 03:30 PM
Hi Benson,

I'm attaching a sample page for your convenience. Take a look at it and let me know if you have any other questions.

The code snippet you have sent compiles correctly so the problem should be somewhere else.
 

Sincerely yours,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Benson
Top achievements
Rank 1
answered on 30 May 2007, 04:26 AM
Support,

Thanks for your sample program.
I finally found out the root problem. In my report, I used some fonts (eg. PMingLiU) which shows in browser without problem, but return error in ReportProcessor.Render. After I use other fonts, the pdf creates without problem.

Thanks.
Benson.
0
Chavdar
Telerik team
answered on 30 May 2007, 08:07 AM
Hi Benson,

It's great to hear that you have managed to find the problem on your own. Would it be possible for you to send us a sample font which causes the error so that we can investigate it? You can send it to support@telerik.com.
 

Kind regards,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Benson
Top achievements
Rank 1
answered on 30 May 2007, 09:48 AM
Original, I use Arial for Report textbox, then Report is ok. But when I switch to use MingLiu, error occurs.
Hope you can find my problem.
 
Benson.
0
Chavdar
Telerik team
answered on 30 May 2007, 04:59 PM
Thanks for the file, Benson. We've managed to reproduce the problem and will research it for a possible solution. Stay tuned for the results.


All the best,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Benson
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Benson
Top achievements
Rank 1
Share this question
or