Community discussion forum

crystal report

Tags: asp.net India
  • 3 years ago
    hi
    i need to create a crystal replort using visual studio 2005 and asp.net2.0 version and the database is

     sqlserver do tell me step by step procedure in creating it


    looking forward for a quick reply


    this is a web application












  • 3 years ago
    Hi Gayathri
     Various method available in Crystal report. We can design depends upon our requirement. Mostly i was designed using .ttx file as used to design a report.

    In normal method U can try this following steps.
     Right Click on ur Project-Add New Item then Select Crystal report.
     After open the crystal report. U choose the Database(Wizard shown automatically)

    After that u can design as per ur requirement.

    Note:
     If no more SpecialFields are not shown after open the crystal report then u press Ctrl+Alt+T

    Regards
    Hari K
















  • 3 years ago

    hey

    can u tellme  how to make the designed crystal report to be displayed in a web page

    plz
    do reply me






  • 3 years ago

    Hi Gayathri
     This follwoing lines are helpful for u load ur cr Report



    Dim rptDoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument

    rptDoc.Load(Server.MapPath("rptDialoutSummary.rpt"))


    'If u set any parameter in ur crystal report

    rptDoc.SetParameterValue(0, "Report Title")
    rptDoc.SetParameterValue(1, "From Period : " & strParamFromDate & " " & " " & " To Period : " & strParamToDate & "")

    rptDoc.SetDataSource(dsRptDataSet.Tables(0))

      ''Convert To Pdf
            Dim iostream As System.io.MemoryStream = CType(rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat), System.io.MemoryStream)
            Response.Clear()
            Response.ContentType = "application/pdf"
            Response.BinaryWrite(iostream.ToArray)
            Response.End()
            iostream.Close()
            iostream = Nothing

    Regards
    Hari K






























  • 3 years ago

    hi friend
    i am using c# in asp.net so could u plz tell me according to c#

    plz
    looking forward for ur reply to the earliest









  • 3 years ago

    Hi Gayathri
     I hope this folloing link may guide you

    http://www.c-sharpcorner.com/UploadFile/rsubhajit/CrystalReportwithDataSet03012006060655AM/CrystalReportwithDataSet.aspx?ArticleID=5c41229b-0d00-4cde-a9e2-c10a917c6521

    Regards
    Hari K









  • 3 years ago

    hi

    in that link i have certain coding
    i need explanation for this
    oRpt = new Customer();
    and also


    comd.CommandText = "upGetAllCustomer";( what is this upGetAllCustomer)
    i think it is a stored procedure name i need to use a query and not a stored procedure so plz tell me in that regard




     

    comd.Parameters.Add("@Companyname",SqlDbType.VarChar,50);



    looking forward for ur reply regarding this











  • 3 years ago

    Hi Gayathri
     Code is also available here.
     
    http://www.codeproject.com/useritems/CrystalReport_DotNET2005.asp

    if u don't have userid and pwd for codeproject try to create otherwise i will send my user id and pwd to u if u give ur personal email id

    Regards
    Hari K











  • 3 years ago

    Hi
     You follow this method

     using CrystalDecisions.Shared;
    using CrystalDecisions.CrystalReports.Engine;

    ------------------u can put this in form load or as per ur requirement button click event

    nItemId = int.Parse(Request.QueryString.Get("ItemId"));
    strStartDate = Request.QueryString.Get("StartDate");
    strEndDate = Request.QueryString.Get("EndDate");


    // object declration
    CrystalDecisions.CrystalReports.Engine.Database crDatabase;
    CrystalDecisions.CrystalReports.Engine.Table crTable;



    TableLogOnInfo dbConn = new TableLogOnInfo();

    // new report document object
    ReportDocument oRpt = new ReportDocument();

    // loading the ItemReport in report document
    oRpt.Load("C:\\Inetpub\\wwwroot\\WroxSellersWeb\\ItemReport.rpt");

    // getting the database, the table and the LogOnInfo object which holds login onformation
    crDatabase = oRpt.Database;

    // getting the table in an object array of one item
    object[] arrTables = new object[1];
    crDatabase.Tables.CopyTo(arrTables, 0);

    // assigning the first item of array to crTable by downcasting the object to Table
    crTable = (CrystalDecisions.CrystalReports.Engine.Table)arrTables[0];

    dbConn = crTable.LogOnInfo;

    // setting values
    dbConn.ConnectionInfo.DatabaseName = "WroxSellers";
    dbConn.ConnectionInfo.ServerName = "Intersoft";
    dbConn.ConnectionInfo.UserID = "farhan";
    dbConn.ConnectionInfo.Password = "farhan";

    // applying login info to the table object
    crTable.ApplyLogOnInfo(dbConn);

    // defining report source
    crViewer.ReportSource = oRpt;


    //setReportParameters();


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

    // this method sets the parameters of the report
    private void setReportParameters()
    {

    // all the parameter fields will be added to this collection
    ParameterFields paramFields = new ParameterFields();

    // the parameter fields to be sent to the report
    ParameterField pfItemId = new ParameterField();
    ParameterField pfStartDate = new ParameterField();
    ParameterField pfEndDate = new ParameterField();

    // setting the name of parameter fields with wich they will be recieved in report
    pfItemId.ParameterFieldName = "ItemId";

    pfStartDate.ParameterFieldName = "StartDate";
    pfEndDate.ParameterFieldName = "EndDate";

    // the above declared parameter fields accept values as discrete objects
    // so declaring discrete objects
    ParameterDiscreteValue dcItemId = new ParameterDiscreteValue();
    ParameterDiscreteValue dcStartDate = new ParameterDiscreteValue();
    ParameterDiscreteValue dcEndDate = new ParameterDiscreteValue();

    // setting the values of discrete objects
    dcItemId.Value = nItemId;

    dcStartDate.Value = DateTime.Parse(strStartDate);
    dcEndDate.Value = DateTime.Parse(strEndDate);

    // now adding these discrete values to parameters
    pfItemId.CurrentValues.Add(dcItemId);
    pfStartDate.CurrentValues.Add(dcStartDate);
    pfEndDate.CurrentValues.Add(dcEndDate);

    // now adding all these parameter fields to the parameter collection
    paramFields.Add(pfItemId);
    paramFields.Add(pfStartDate);
    paramFields.Add(pfEndDate);

    // finally add the parameter collection to the crystal report viewer
    crViewer.ParameterFieldInfo = paramFields;
    }


    Regards
    Hari K










































































































  • 7 months ago
    there is onw step by step tutorial for Crystal Reports in C# http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-stepbystep.htm carlos.

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback