Report not display in report viewer - asp.net

i try to show ssrsc reports in asp.net web page using report viewer
code
protected void Button1_Click(object sender, EventArgs e)
{
ReportViewer2.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
ReportViewer2.ServerReport.ReportServerUrl = new Uri("http://lenovo-pc/ReportServer");
ReportViewer2.ServerReport.ReportPath = "/Report Project1/Report1";
ReportViewer2.ServerReport.Refresh();
}
where is the probelm... and why report not display?

It tells you the problem in the error message:
Login failed for 'administrator'
The account that you are trying to run the report under does not have access to the database or table that DataSource1 is trying to connect to.
Note that, for security reasons, connection credentials do not propagate when you deploy a report. You may need to set these up for that report on the server that it is deployed to.
Alternatively, you may need to pass the appropriate credentials as part of your code when you run the report.

Related

IIS Logs do not show the message logged

I am trying to log the entire exception to the IIS log in the following way:
public void OnTransientFaultOccurred(object sender, RetryingEventArgs e)
{
_httpResponse.AppendToLog(string.Format("RetryCount:{0}", e.CurrentRetryCount));
_httpResponse.AppendToLog(string.Format("NextRetryIn:{0}ms", e.Delay.TotalMilliseconds));
_httpResponse.AppendToLog(string.Format("Exception:{0}",e.LastException));
}
But the log only shows '...'.
Is there any limit in terms of how much data can be written to the log ?
One thing to try: Make sure the advanced logging extension is enabled.
As per Append custom value to IIS logs from ASP.NET.

How to show Crystal Report preview without SQL Server log in authentication?

In asp.net 4.0, when we create report in Crystal Reports using ADO.NET objects, we face a problem that after successfully creating the report preview, the report wants a user id and password for SQL Server. How can I solve this?
When I want to attached ADO.NET object in Crystal Reports it wants an XML file. How can I configure or connect it?
Hey Please refer this code to Resolve your Problem
protected void Page_Load(object sender, EventArgs e)
{
ReportDocument crystalReport = new ReportDocument();
crystalReport.Load(Server.MapPath("CrystalReport.rpt"));
crystalReport.SetDatabaseLogon("username", "password", #"server name", "DB name");
CrystalReportViewer1.ReportSource = crystalReport;
}
hope it will help
If you are getting this after deployee, than you might have reporting server running in same server same port same folder (default port 80, default folder "reports")
to resolve you can do one of
1) Change you name of your reports folder name other than "reports"
or
2) Change the reporting service report manager URL (port or virtual directory name) as in below steps
Step 1 : Type Reporting Service Configuration Manager in Run.
Step 2 : Go to Web Service URL and change TCP Port.
Step 3 : Go to Report Manager URL and go the Advance and Edit the Port Number.
Step 4 : Save it, and all is Done.

Report is not recognizing the parameter being passed

I created a report and deployed on Reporting Services Server. This report is populated using a stored procedure which receives an input parameter: #RecordID.
In the report also, I added a variable with the name RecordID.
In my Visual Studio project, I added Report Viewer control and set the path of the server report. When I open this report on Web Page, it displays error:
Parameter 'RecordID' does not exist on this report
The code in the code-behind file is:
protected void Page_Load(object sender, EventArgs e)
{
Microsoft.Reporting.WebForms.ReportParameter Param = new Microsoft.Reporting.WebForms.ReportParameter("RecordID","3");
ReportViewer1.ShowParameterPrompts = false;
ReportViewer1.ServerReport.SetParameters(Param);
ReportViewer1.ServerReport.Refresh();
}
Edited
I added a variable using Report Properties in Business Development Studio. Below is the image. This variable is set to receive value of the parameter.
In this you see the steps to add a new parameter and to link it to the Dataset.

Basic facebook web application session info is missing

I made really basic facebook application, which collect permission from user to post data. Some time ago (around New year) it worked fine.
I am using http://facebooktoolkit.codeplex.com, and my code looks like this:
public partial class Facebook : CanvasFBMLBasePage
{
protected void Page_Load(object sender, EventArgs e)
{
if(this.Api.Users.HasAppPermission(global::Facebook.Schema.Enums.ExtendedPermissions.publish_stream))
And at this moment I am having exception: parameter uid or session key required
As i understand, I should have some session defined by Facebook and CanvasFBMLBasePage should parse it, and make it possible to use application, but this is not happening.
My application settings (maybe I mis something):
Canvas Callback URL: http://www.domain.com/app/action/facebook.aspx?
Render Method: FBML
Also, I put my IP in server whitelist.
Thanks for help
Have you called the "ConnectToFacebook" method in the api before calling "HasAppPermission"?

Track each request to the website using HttpModule

I want to save each request to the website. In general I want to include the following information:
User IP, The web site url, user-if-exist, date-time.
Response time, response success-failed status.
Is it reasonable to collect the 1 and 2 in the same action? (like same HttpModule)?
Do you know about any existing structure that I can follow that track every request/response-status to the website?
The data need to be logged to sql server.
Look in your web server logs.
How about IIS logs? they already have all the data items you listed so far
In BeginRequest Method you need to write the following code.
protected void Application_BeginRequest(object sender, EventArgs e)
{
//String s = HttpContext.Current.Request.Path;
//HttpContext.Current.RewritePath("Login.aspx");
String referrer = HttpContext.Current.Request.UrlReferrer;
String sourceIP = HttpContext.Current.Request.UserHostAddress;
String browser = HttpContext.Current.Request.UserAgent;
}

Resources