Page 1 of 1

Print & Export TChart.net problem

Posted: Wed May 19, 2004 6:49 am
by 8125487
Dear Sir/Miss

I found 2 error in the print and export tchart in the webform runing vb.net code behind.

1. Export
The code work well to export the chart data to excel file format. but when I try to open the exported file using Ms Office XP Pro. It keep on popup the error message. "Unable to read file" What is the problem?

Private Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnExport.Click
Dim objExport As Steema.TeeChart.Export.ExcelFormat = TChart.Chart.Export.Data.Excel
Dim FilePath As String
FilePath = Request.ServerVariables("APPL_PHYSICAL_PATH") _
& "DesignTemp\Test.xls"
objExport.IncludeHeader = True
objExport.IncludeIndex = True
objExport.IncludeLabels = True

objExport.Save(FilePath)
FilePath = "http://" & Request.ServerVariables("HTTP_HOST").ToString _
& "/MyWeb/" _
& "DesignTemp\Test.xls"
Response.Redirect(FilePath)
objExport = Nothing
End Sub

2. Print.
When I try to do print preview at the webform and the error page will keep on display as below. As i understand is because the client site couldn't access the server form. but how to do the print preview in webform?
'#############################################
Dim objPrint As Steema.TeeChart.Chart = TChart.Chart
objPrint.Printer.Preview()
'#############################################

It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

And I really feel disppointed about the TChart.net version.
After i upgrade the TChart v5 to Tchart.net version, I found that a lot function is not work properly.

The Multi-Language is not work properly for display the chineses word. It keep on showing the funny character, even I change the webform charset = Chinese Simplified (GB2312) and that is no answer from you.

Anyway if that is no answer for it, we decide to refund the TChart.net.

Cliven
Metierview
BI Consultant

Export problem more detail (unable to read)

Posted: Thu May 20, 2004 6:25 am
by 8125487
Dear Sir/Miss

I found the export error more detail.

I get the unable to read file error message popup from ms office XP pro if I set the TChart.Chart.Export.Data.Excel.IncludeHeader = True

Tchart Header Text = "Test Giant Mart ( Measures By : Units Ordered)"
But I get the same error even i change the header text to "Test".

Anyway Please let me know whether you got the solution for the question that I post.


Cliven

Posted: Thu May 20, 2004 10:20 am
by Chris
Hi --
1. Export
The code work well to export the chart data to excel file format. but when I try to open the exported file using Ms Office XP Pro. It keep on popup the error message. "Unable to read file" What is the problem?
Again, using the VB.NET ASP.NET example under:
C:\Program Files\Steema Software\TeeChart for .NET v1\TeeChartForNET\WebFormVB

I added in the following button:

Code: Select all

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim objExport As Steema.TeeChart.Export.ExcelFormat = WebChart1.Chart.Export.Data.Excel
        Dim FilePath As String
        FilePath = Request.ServerVariables("APPL_PHYSICAL_PATH") _
        & "DesignTemp\Test.xls"
        objExport.IncludeHeader = True
        objExport.IncludeIndex = True
        objExport.IncludeLabels = True

        objExport.Save(FilePath)
        FilePath = "http://" & Request.ServerVariables("HTTP_HOST").ToString _
        & "/TeeChartforNET/WebFormVB/" _
        & "DesignTemp/Test.xls"
        Response.Redirect(FilePath)
        objExport = Nothing
End Sub
The resulting Excel file opened perfectly in both MS Office XP and MS Office 2003.
2. Print.
When I try to do print preview at the webform and the error page will keep on display as below. As i understand is because the client site couldn't access the server form. but how to do the print preview in webform?
Trying to use the Print Preview in a WebForm is like trying to use a MessageBox in a WebForm. This is because the two WinForm components used to build the TeeChart Print Preview, PrintPreviewDialog and PrintPreviewControl, simply do not exist as WebForm components.

Posted: Thu May 20, 2004 10:24 am
by 8125487
Hi.
I did solved the export problem. Here to share with those people have a same problem. but this is not a good solution. :lol:

Print Chart
I just export the TChart to JPG file and send to client site use the IE print button to print the chart picture.

Export Excel Data
I just set the
TChart.Chart.Export.Data.Excel.IncludeHeader = False

Anyway Thank for those people trying to solution this problem.

Cliven Yong