shatrughna fuke
how to generate crystal report using code
By shatrughna fuke in Windows Forms on Jan 13 2011
  • samar jeet
    Apr, 2016 22

    Public Sub FLoadMainReport(ByVal StrReportName As String, ByVal DTTable As DataTable)RptMain = New ReportDocumentDTTable.WriteXmlSchema(LIPublic.StrPubXMLPath & "\" & StrReportName & ".xml")RptMain.Load(LIPublic.StrPubReportPath & "\" & StrReportName & ".rpt")RptMain.SetDataSource(DTTable)End SubFLoadMainReport(StrReportFor, DTTemp) FShowReport(ReportName, Me.MdiParent, Me.Text)Public Sub FShowReport(ByVal RpdReg As CrystalDecisions.CrystalReports.Engine.ReportDocument, _ByVal FrmMDI As Form, ByVal StrReportCaption As String, Optional ByVal BlnDirectPrint As Boolean = False, _Optional ByVal StrPaperSizeName As String = "", Optional ByVal StrLandScape As String = "")Dim PDPrint As System.Drawing.Printing.PrintDocumentDim PRDGMain As PrintDialog = NothingDim I As IntegerDim IntRawKind As IntegerDim NRepView As RepViewIf Trim(StrPaperSizeName) <> "" ThenPDPrint = New System.Drawing.Printing.PrintDocument()For I = 0 To PDPrint.PrinterSettings.PaperSizes.Count - 1If UCase(Trim(PDPrint.PrinterSettings.PaperSizes(I).PaperName)) = UCase(Trim(StrPaperSizeName)) ThenIntRawKind = CInt(PDPrint.PrinterSettings.PaperSizes(I).GetType().GetField("kind", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic).GetValue(PDPrint.PrinterSettings.PaperSizes(I)))RpdReg.PrintOptions.PaperSize = IntRawKindRpdReg.PrintOptions.PaperOrientation = IIf(Trim(UCase(StrLandScape)) = "Y", CrystalDecisions.Shared.PaperOrientation.Landscape, CrystalDecisions.Shared.PaperOrientation.Portrait)If Not BlnDirectPrint ThenPRDGMain = New PrintDialogPRDGMain.PrinterSettings.PrinterName = PDPrint.PrinterSettings.PrinterNamePRDGMain.PrinterSettings.DefaultPageSettings.PaperSize = PDPrint.PrinterSettings.PaperSizes(I)PRDGMain.PrinterSettings.DefaultPageSettings.Landscape = IIf(Trim(UCase(StrLandScape)) = "Y", True, False)End IfExit ForEnd IfNextEnd If

    • 0
  • Fawad Mirza
    Jan, 2011 23

    dear if u want to know about this contact me on this mail ID : [email protected]
    i will give u the project on it which will help u

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS