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
 SharePoint interview questions  SharePoint 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 ?    3 Yes 3 No
Ranjith Reddy
 

 
 
 
Other VB.NET Interview Questions
 
  Question Asked @ Answers
 
how to connect crystal report with vb.net ? Patni2
What is versioning in .NET?  2
What is an indexed property?  1
What is DLL hell?  2
In vb.net how to connect crystal report?  1
Difference between VB dll and assemblies in .NET ? Digital-GlobalSoft5
linex will support dot net? Phoenix-Technologies4
What is the Difference between Dataset and Datareader?  4
What is the Difference between Web User Control and Web Custom Control?  5
if user enters 1 or 2 or any other number in digit format in next textbox it should show the answer in word reading like if enters 12 answer should be twelve  4
Where would you use Abstract class and Interface?  2
when a program of vb.net is written in notepad it occupies always 1kb of memory why?  1
I want to reduce my CPU Usage when I am querying the Database for records. Now my Winform App(in VB.Net) suddenly Jumps to 100% CPU Usage when i query for records from sql server database. I want this Usage to be less. Any help is appreciated  2
How do you validate Date by using which validation Control? HCL3
is it possible to use flexgrid in vb dotnet? Microsoft7
how to restore database using vb.net? TCS4
How to Insert a TextBox value in to Sql database using VB.Net coding?  3
What is the difference between Dataset and Recordset?  7
concept of object oriented programming Patni5
What is VB.Net? Ksb3
 
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