-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: srkrishnakumar
Message 3 in Discussion

Hi,          Thanks for the reply.The following coding i used for exporting 
data into pdf file.This same coding will work fine ,when i export into .doc 
format or the  other format. But when i export into pdf,it japanese characters 
not displayed in the pdf,instead small box are displayed.Please help in this.   
  Imports System.Data.SqlClient
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine

Public Class WebForm1
   
   Inherits System.Web.UI.Page
   Dim rpt As New CrystalReport1

   Private Sub Page_Load(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles MyBase.Load
       'Put user code to initialize the page here

       Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
       Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
       Dim myDS As New Dataset1
       Dim myConnection As New SqlConnection
       Dim myCommand As New SqlCommand
       Dim myDA As New SqlDataAdapter

       'crpt4.SetDataSource(objDS.Tables(0))
       rpt = New CrystalReport1
       For Each myTable In rpt.Database.Tables
           myLogin = myTable.LogOnInfo
           myLogin.ConnectionInfo.Password = "database password"
           myLogin.ConnectionInfo.UserID = "database username"
           myTable.ApplyLogOnInfo(myLogin)
       Next

       
       Try
           myConnection = New SqlConnection("SERVER=servername;USER 
ID=dbusername;PWD=dbpassword;DATABASE=databasename;")
           myCommand.Connection = myConnection
           myCommand.CommandText = "select * from tablename"
           myCommand.CommandType = CommandType.Text
           myDA.SelectCommand = myCommand
           myDA.Fill(myDS, "tablename")
           rpt.SetDataSource(myDS)
           CrystalReportViewer1.ReportSource = rpt

       Catch ex As Exception

       End Try


   End Sub

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles Button1.Click
       Dim crDiskFileDestinationOptions As New DiskFileDestinationOptions
       rpt.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
       rpt.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
       crDiskFileDestinationOptions.DiskFileName = "C:\rptfolder\MyRpt.pdf"
       rpt.ExportOptions.DestinationOptions = crDiskFileDestinationOptions
       rpt.Export()

   End Sub
End Class


-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/mumbaiusergroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to