Link to home
Start Free TrialLog in
Avatar of Sirdots
Sirdots

asked on

Passing login Id to the text object in crystal report viewer using asp.net c#

I have two web forms. One is a login page
and the other is the main page

Main page uses a crystal report viewer to
display a document

users will log in with user id and password using
forms authentication


1. On the report footer, I want to display the user Id
   on a text object, entered at logon, a time stamp on
   another text object and then on the click of a button
   create a pdf file(pdf file creation is working)  

Is it possible to pass values to this text objects?


Code for pdf creation
-------------------------

protected void Button1_Click(object sender, EventArgs e)
    {
        ReportDocument doc = new ReportDocument();
        Response.Buffer = false;
        Response.ClearContent();
        Response.ClearHeaders();
        string rptFile = "CrystalReport1.rpt";
        string myStudentId = "102346";
        string fileName = Server.MapPath(rptFile);
        doc.Load(fileName);
        //doc.ExportToHttpResponse(ExportFormatType.PortableDocFormat,Response,true,"Customers");
        doc.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, myStudentId);

    }
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sirdots
Sirdots

ASKER

This gives an idea. It doesnt really show how to create parameter fields in crystal report