Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have been at this for weeks. When a user logs into the website they start off in a session. The user fills out the web form and submits the data into the database. The user can click on the print button and print out a report of the data they just entered. This issue is that when the user clicks the print button it pops up a print preview of the report but it is not the current users data on the report. I made the report in CR 2013 using a SQL database. Then I added it to the web project. Added a new web form, crystalreportviewer and the report to the crystalreportviewer. How can I fix this issue? I just want to print the report with the current user that is logged in data.

This is the code that is on the web form that has the Crystalreportviewer on it.

C#
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using CrystalDecisions.Web;
using System.Web.UI.WebControls.WebParts;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Xml.Linq;
using System.Web.SessionState;


namespace SACSCOCLogin1._1
{
    public partial class ReportFormA : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            CrystalReportViewer1.Visible = true;
            TextBoxINST_ID.Text = Session["inst_id"].ToString();
        }
        
    }
}
Posted
Updated 14-Feb-14 9:32am
v2

1 solution

We cannot help from just your description. Please post your code, the data source for the report, etc. The more details you provide the better help we can give.
 
Share this answer
 
Comments
Computer Wiz99 14-Feb-14 15:30pm    
AnvilRanger, How can i post the data source for the report? I don't have any code behind for the report. All I have is this (look at update code).
AnvilRanger 15-Feb-14 0:45am    
It sounds like you are using something built into Crystal Reports to handle the data source. The question is then how are you passing the id stored in session to the report?
Computer Wiz99 18-Feb-14 12:45pm    
I don't know. I would I do that?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900