ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  VB.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
how to create crystal reports in asp.net & vb.net with 
syntax
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: how to create crystal reports in asp.net & vb.net with syntax
Answer
# 1
First create crystal report.In the interface of report i.e
aspx form to display report,add report document as
Toolbox-->Components-->ReportDocument.
Call the sub routine CreatePDF to display report.
rptProduct is the name of crystal report and docProd is the
name of report document.



								
Imports System.Data
Imports System.Data.SqlClient
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.IO

'This call is required by the Web Form Designer.
     Private Sub InitializeComponent()
        'start - This code should be pasted under #Region
Private Sub itializeComponent()
'rptProduct is the name of crystal report.
        Me.docProd = New rptProduct
        '
        'docProd
        '
        Me.docProd.PrintOptions.PaperOrientation =
CrystalDecisions.Shared.PaperOrientation.DefaultPaperOrientation
        Me.docProd.PrintOptions.PaperSize =
CrystalDecisions.Shared.PaperSize.DefaultPaperSize
        Me.docProd.PrintOptions.PaperSource =
CrystalDecisions.Shared.PaperSource.Upper
        Me.docProd.PrintOptions.PrinterDuplex =
CrystalDecisions.Shared.PrinterDuplex.Default
'Ends here
    
'Declaration of report document
Protected WithEvents docProd As rptProduct

Private Sub CreatePDF()        
        Dim objDS As New DataSet
        Dim dfdoFile As New
CrystalDecisions.Shared.DiskFileDestinationOptions
        Dim strServerPath As String
        Dim szFileName As String

       
            'Create dataset as per requirement

            docProd.SetDataSource(objDS.Tables(0))

            szFileName = Session.SessionID & ".pdf"        
' rptDailyCalls.pdf
            strServerPath = MapPath("~") & "\Report\"      
' Here the pdf file will be saved.   
                     File.Delete(strServerPath & "\" &
szFileName)   ' Delete file first
            dfdoFile.DiskFileName = strServerPath & "\" &
szFileName
            With docProd
                .ExportOptions.ExportDestinationType =
CrystalDecisions.Shared.ExportDestinationType.DiskFile
                .ExportOptions.ExportFormatType =
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
                .ExportOptions.DestinationOptions = dfdoFile
                .Export()
            End With
       'URL of the pdf file
 Response.Redirect("http://localhost/WebApplication1/" &
szFileName ,Flase)
End Sub
 
Is This Answer Correct ?    2 Yes 1 No
Ranjith Reddy
 

 
 
 
Other VB.NET Interview Questions
 
  Question Asked @ Answers
 
sql satement for 2nd maximum value  10
What is CLR?  8
How does you get record no from 5 to 15 from a dataset of 100 records? ABC1
Display a roll having minimum marks in two subjects? Patni1
how to restore database using vb.net? TCS4
what is the dif b/w panel and groupbox. Ksb3
Do event have return type?  7
There are three versions of VB6--Learning Edition, Professional and Enterprise. Is VB.Net similar?  1
how to connect crystal report with vb.net ? Patni6
how to connect crystal report with vb.net ? Patni2
how to get sum of two numbers in vb.net?  2
What is shadowing? TCS2
what are Fixed memory leaks and threads locking problems. US-Technology1
How do you rate yourself in .NET ? Infosys3
Disadvantages of vb ? Digital-GlobalSoft3
how can we assigns items on listbox so that it will show rowwise please write the code for it.  3
how to create crystal reports in asp.net & vb.net with syntax  1
hey friends, Firstly I pick the records from the database into the DataGridView, Then I want that If I made any changes to the records in the GridView & Click on Update Button, Changes are Reflected into the main Database .Plz do reply back  1
What is MSIL. HDFC2
Difference between VB dll and assemblies in .NET ? Digital-GlobalSoft5
 
For more VB.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com