RDLC Report Viewer Drill Through Report - asp.net

I had posted this question on MSDN Forum
http://social.msdn.microsoft.com/Forums/en/vsreportcontrols/thread/f00e3406-354d-4f54-acce-7b7f0ad4c90f
But I am not getting any response. Can you please help me. I am really stuck with this rather simple task.
My code seems to be correct but still I get the
A data source instance has not been supplied for the data source 'DataSet1_Order_Details'.
Sorry for the cross post...

I had a same experience and it was because I try tosee the report from a wrong place, let me explain
There is a dataSet in RDLC reports
There is a method in DAL which get data from db
There is a Method in BAL or UI which call the DAL method and fill dataset. Most of time this is a unique page which get some parameter from user and fill dataset and finally redirect user to the report viewer page.
your eror appears in report viewer page
So the following may happened
you enter directly to reportviewer page without filling dataset
you went to correct page and fill the dataset but inreport viewer pageyoudidn't bind your dataset to your report in code behind.
in some cases it can be because of session expiration.

This worked for me, too, though the real key was right here:
((LocalReport)e.report)
In my case, I am using:
((LocalReport)e.report).LoadReportDefinition(report_stream);
foreach (ReportParameter rp in ((LocalReport)e.report).OriginalParametersToDrillthrough)
{
_paramCollection[rp.Name].parameterValue.AddRange(rp.Values.OfType<string>());
}
DataTable newData = GetData();
ReportDataSource rds = new ReportDataSource();
rds.Name = _datasetName;
rds.Value = newData;
((LocalReport)e.report).DataSources.Add(rds);
The reportviewer handles the rest. #Knows Not Much, thanks for the lead.

I solved the error.
I was adding the data source like
this.ReportViewer.Localreport.DataSource.Add
(new RemoteDataSource("DataSet1_Order_Details", ObjectDataSource2.ID));
instead the data source should be added in the following manner
DataSet1TableAdapter.OrderDetails od = new DataSet1TableAdapter.OrderDetails();
((LocalReport)e.report).Datasources.Add(new RemoteDataSource("DataSet1_Order_Details", od.get(orderid))
this resolved the issue and now I am able to have drill down in the ReortViewer report.
Regards,
Abhishek

Related

Power BI: Real time (date/time data) does not get refreshed on creating a report

I am streaming real time tweets using R script and sending it to Power BI using (Streaming data and REST API) to create a live streaming dashboard.
I have to create a tile which shows tweets over time. But the date/time field does not get reflected in the tile, it is just empty.
I'm not sure if I have to change the datatype or format of the field? Below is how the date/time field looks in R.
The streaming dataset is as below:
Below is the tile I created (Shows blank)
If you don't see anything in the tile, probably your dataset doesn't received anything. Try to post some data manually, e.g. from a PowerShell script (place the correct URL):
$endpoint = "https://api.powerbi.com.com/beta/........."
$Time_Stamp = ($Time_Stamp = Get-Date).Datetime
$payload = #{ "date" = $Time_Stamp; "count" = 98.6; "score" = 98.6 }
Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json #($payload))
Does anything shows up in the tile? As we see from your screenshot, you enabled Historic data analysis. This means that you can create reports with this dataset. Try to make one to show the contents in a table. Is there any rows in this dataset?
UPDATE: Actually, to be sure, copy the sample PowerShell code to post to your dataset and try it. Go to the list of datasets in your workspace, find your one in the list and click on the (i) icon. Then from API Info panel go to PowerShell and copy/paste the code in PowerShell ISE to execute it:
Also, keep in mind that the tile will auto update itself only in a dashboard. You may need to refresh the report to get the up to date data, if you are looking at the tile in a report.

Cannot add new correlated record to new created record

When I create new record in Google AppMaker and then try to add correlated record to this new one I get this warning in console:
com.google.apps.appmaker.client.datasource.AbstractModelDataSource
WARNING: Could not find element with key RecordKey{key=private$7,
model key=...
Both datasources are set to:
Manual save mode
Automatically load data
The problem doesn't appear when I refresh the page or try to add correlated record to other existing record.
Anybody knows what could be a reason for this error?
App Maker doesn't allow to have unsaved changes on both ends of relation, most likely it is a reason, why you recieve error message in the first case. But in theory it should work once you save one of the relation ends (first save one of the records and then link them and save again):
var countryDs = app.datasources.Country;
var capitalDs = app.datasources.Capital;
countryDs.createItem();
countryDs.item.Name = 'United States';
countryDs.saveChanges(function() {
capitalDs.createItem();
capitalDs.item.Name = 'Washington, D.C.';
capitalDs.item.Country = countryDs.item;
capitalDs.saveChanges();
});
OK, I fixed it.
I have two forms. First to create item. Second to edit data. In the first form page need to be set to:
On Detach: Clear Changes To Datasource.
Datasources need to be set to autosave.

Devexpress End user Report Designer: Datasource binding is null when retrieve report from database

I am creating reporting server using asp.net mvc web api. I am retrieving data from web api retriving report using XRDesignForm object of devexpress. I am posting back report data to web api. what issue i am facing is, and if i use xtrareport obejct and bind datasource manually it work fine.i.e.
XtraReport report = new XtraReport();
report.DataSource = setupSummary.FillDataSet();
report.DataMember = ((DataSet)report.DataSource).Tables[0].TableName;
designForm.OpenReport(report);
//designForm.Show();
designForm.ShowDialog(this);
I can successfully mainuplate this report and can save into database,
But as shown in articles for ReportStorage, if i only retrieve report from database using report name from server, datasource is always null.i.e.
XRDesignForm designForm = new XRDesignForm();
string url = GetSelectedUrl();
if (!string.IsNullOrEmpty(url))
designForm.OpenReport(url);
designForm.ShowDialog(this);
It seems that when saving dynamic report into database (as binary), It loss data source bindings.
please help me for this.
thanks
Aqdas, thank you very much.
There is a similar error in the report layout,
My solution is, after the layout again set DataSource
XtraReport rep = null;
rep = new rptReqVac();
Stream layoutStream = null;
layoutStream = mGetLoyoutStream(id);
rep.LoadLayout(layoutStream);
rep.DataSource = new dsREQPrintVac();
reportDesigner.OpenReport(rep);
Hope it will help someone :-)
Finally after spending lot of time, i had fixed this, Issue is actually when you save report to database as binary, it skip DataAdapter for report. so before saving you need to do first null to dataadapter or report and then assaing again before you get buffer for report layout.
Hope it will help someone :-)

report viewer didn't show reports

I try to view reports in my report viewer but it show nothing
my on load function where the report viewer is
like :
if(!IsPostBack)
{
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath = "Reports/MainReport.rdlc";
DataTable orderDt = controller.SelectFullOrderDetailsInfo(orderID);
ReportDataSource rptds = new ReportDataSource("OrderInfo", orderDt);
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(rptds);
ReportViewer1.LocalReport.Refresh();
ReportViewer1.DataBind();
}
Report viewer page just run empty and didn't show any thing ! what I'm missing
I know my reply is 5 years after the question is asked :), but I put my findings here, hopefully, it will save time for others in the future.
Recently I have done 60 reports for my company. Bellow are causes of a report not showing:
1: Most Frequent case: You report has parameters which can be empty or null. If you have parameters make sure you specify that those parameters can accept empty or null values, otherwise re[rot shows as empty. To verify, remove all parameters from the report and run it without any parameters.
2: Check rptds Table(report DataSource) to make sure it is populated.
3: (This one happened to a couple of times). Browse your code to make sure you do not set the report viewer visibility to false.

How it is possible to print client side(browser) datetime in crystal report?

In asp.net website, i am using crystal report. My question is very generic i.e. How it is possible to display client side (browser) date and time?
Actually in my case our website is going to hosted at India, while that site is used by user's at SWEDEN.
Now the problem is that when user request for report then it is displaying server side date time because i have used PRINTTIME control of crystal report. But user should have date and time of their PC. because that time is basically a report generates date time.
Please help me?
When you call the report you could pass the users datetime as a parameter?
In the Field Explorer in Crystal you can add the DateTime parameter to your report.
I only know how to call the report through c# but I guess it can't be too different.
Using the crystal decisions engines in my project I add them like so:
CrystalDecisions.CrystalReports.Engine.ReportDocument myDataReport = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
myDataReport.Load(#"C:\ReportLayouts\YourReportHere.rpt");
myDataReport.SetDataSource(dtGraph); // Your data table/data set here..
myDataReport.Refresh();
// Here is where you pass the parameter..
myDataReport.SetParameterValue("YourParameterNameInReport", DateTime.Now);
Stream msPDFGraph = myDataReport.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
myDataReport.Close();
return msPDFGraph;
Hope this helps :)

Resources