Attempt to assign data set as datasource for existing report
There must be something stupid I am missing.
1) Created a report with Crystal Reports 2011
2) It queries a table in a SQL 2008 database
3) The internal select statement is
SELECT "CUSTOMER"."rname", "CUSTOMER"."radd", "CUSTOMER"."radd2", "CUSTOMER"."rcity", "CUSTOMER"."rprov", "CUSTOMER"."rpostal", "CUSTOMER"."rcountry"
FROM "Data"."dbo"."CUSTOMER" "CUSTOMER"
ORDER BY "CUSTOMER"."rname"
4) Now I am attempting to use the report in Visual Basic 2010 but using a data set as the source
5) Following examples I have looked at this is the code
Private Sub CustomerCrystalReport2frm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
' Define connection information
Dim ConnectionInfo As New ConnectionInfo
ConnectionInfo.ServerName = "TEST7\TEST7"
ConnectionInfo.DatabaseName = "Data"
ConnectionInfo.UserID = "Master"
ConnectionInfo.Password = "MasterPassword"
' Load the existing report
Dim rd As ReportDocument = New ReportDocument
rd.Load(Application.StartupPath & "\Crystal Reports\DGVCustomerListing.rpt")
SetDBLogonForReport(ConnectionInfo, rd) ' Set the report table connections
' This shows the report has loaded the records using the internal select statement (18305 records)
Debug.Print(" Report Document Records=" & rd.Rows.Count)
' Create the data set with the records I want the report to use
Dim ReportInfo As DataSet = New DataSet() ' To hold data to pass to the report
Dim SQLSelect As String = "select * FROM Data.dbo.Customer where rname LIKE 'z%' order by rname"
ReportInfo = FillDataSet(SQLSelect, "ReportData") ' Fill the data set to pass to the report
' This shows the data set contains the expected records (57 records)
Debug.Print(" Data Set Records=" & ReportInfo.Tables("ReportData").Rows.Count)
' Change the source of the report
rd.SetDataSource(ReportInfo)
' This changing the source had no effect records still (18305 records)
Debug.Print(" Report Document Records=" & rd.Rows.Count)
CrystalReportViewer1.ReportSource = rd ' Bind report document to crystal report viewer
End Sub
Private Sub SetDBLogonForReport(ByVal ConnectionInfo As ConnectionInfo, ByVal ReportDocument As ReportDocument)
Dim Tables As Tables = ReportDocument.Database.Tables
For Each table As CrystalDecisions.CrystalReports.Engine.Table In Tables
Dim TableLogOnInfo As TableLogOnInfo = table.LogOnInfo
TableLogOnInfo.ConnectionInfo = ConnectionInfo
table.ApplyLogOnInfo(TableLogOnInfo)
Next
End Sub
end Sub
6) The report is appearing in the viewer with 18305 records
Any help would be appreciated
Setting the report table connections caused the report to fill with data.
At this point I seemed unable to reset the datasource.
Also the set data source needed further clearification.
The simplified following code works:
Dim rd As ReportDocument = New ReportDocument
rd.Load(Application.StartupPath & "\Crystal Reports\DGVCustomerListing.rpt")
' Create the data set with the records I want the report to use
Dim ReportInfo As DataSet = New DataSet() ' To hold data to pass to the report
Dim SQLSelect As String = "select * FROM Data.dbo.Customer where rname LIKE 'z%' order by rname"
ReportInfo = FillDataSet(SQLSelect, "ReportData") ' Fill the data set to pass to the report
' Change the source of the report
rd.SetDataSource(ReportInfo.Tables("ReportData"))
CrystalReportViewer1.ReportSource = rd ' Bind report document to crystal report viewer
Similar Messages
-
Hi,
"Report Builder is a report authoring environment for business users who prefer to work in the Microsoft Office environment.
You work with one report at a time. You can modify a published report directly from a report server. You can quickly build a report by adding items from the Report Part Gallery provided by report designers from your organization." - As mentioned
on TechNet.
I wonder how a non-technical business analyst can use Report Builder 3 to create ad-hoc reports/analysis with list of parameters based on other data sets.
Do they need to learn TSQL or how to add and link parameter in Report Builder? then How they can add parameter into a report. Not sure what i am missing from whole idea behind Report builder then?
I have SQL Server 2012 STD and Report Builder 3.0 and want to train non-technical users to create reports as per their need without asking to IT department.
Everything seems simple and working except parameters with list of values e.g. Sales year List, Sales Month List, Gender etc. etc.
So how they can configure parameters based on Other data sets?
Workaround in my mind is to create a report with most of columns and add most frequent parameters based on other data sets and then non-technical user modify that report according to their needs but that way its still restricting users to
a set of defined reports?
I want functionality like "Excel Power view parameters" into report builder which is driven from source data and which is only available Excel 2013 onward which most of people don't have yet.
So how to use Report Builder. Any other thoughts or workaround or guide me the purpose of Report Builder, please let me know.
Many thanks and Kind Regards,
For quick review of new features, try virtual labs: http://msdn.microsoft.com/en-us/aa570323Hi Asam,
If we want to create a parameter depend on another dataset, we can additional create or add the dataset, embedded or shared, that has a query that contains query variables. Then use the option that “Get values from a
query” to get available values. For more details, please see:http://msdn.microsoft.com/en-us/library/dd283107.aspx
http://msdn.microsoft.com/en-us/library/dd220464.aspx
As to the Report Builder features, we can refer to the following articles:http://technet.microsoft.com/en-us/library/hh213578.aspx
http://technet.microsoft.com/en-us/library/hh965699.aspx
Hope this helps.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
XML data set picture gallery for thinkbox/lightbox/lightwindow ?
Hi, I want to do a gallery using thickbox or lightwindow or
lightbox. I have the pictures in XML file. How can I make a
pictures gallery using data set. I loaded the XML hive and I
pointed to the pictures and gave them ds1
but when I put link reference to {perspImage}
I click the link and I get new browser window not even
lightwindow. Can someone with some experience help?
(I linked all scripts, css already in the HTML and I tested
it on a single picture and it worked but I need to get a gallery
based on images in XML file) please help.
ThanksI managed to mash Spry/thickbox/jquery/XML together
http://www.stjohnhistoricalsociety.org/Photographs.htm)
several years ago. I can't really remember the details very
well - but I
had to reverse the normal sequence of thickbox magic
enhancement followed by Spry region expansion. -
No data set found when creating a report
Dear all,
This is my first time using BI Publisher, and I am stuck at a very early stage.
I have followed the various steps described in the documentation, up to creating a new report.
When I try to do so, I fail as there is no available data set in the left panel.
Another curious behaviour is that I have first to export and then import sample data as xml for the sample to be saved. Otherwise, when I just click on 'Save as Sample Data', the sample file appears to be associated with the dataset, but disappears at the next logon.
What would cause such behaviours?
Are these issues linked?
Is it a configuration/setup issue?
Or could it be a privileges/roles issue?
Cordially,
AlbainVitaly,
1. Yes, I checked "More Data Sources" - not there.
2. I tried adding the Field Definitions using Control Panel Add/Remove - no help.
I tried removing the "Field Definitions" and then adding them again - no help.
3. Another machine does have the same version of CR. It is running Vista. Problem machine is running XP.
4. Clicked the "Reinstall" button in the Control Panel Add/Remove - this fixed the problem. I did not need to uninstall the program.
Both machines now exhibit the same list of connection types (with one small exception). Thank-you for your hellp.
.... Warren
Edited by: Warren Pickell on Oct 23, 2009 11:55 PM
Edited by: Warren Pickell on Oct 23, 2009 11:56 PM
I'm trying to indicate "Yes, my question has been answered.", but it does not seem to "take". -
Web Service as Datasource for a Report
hello.
current situation:
CR2008 (12.3.0.601)
webservice is created.
webservice is bound as datasource in CR.
report creation works fine.
but:
i would like to provide key information for the tables specified in WS-XSD.
something like (marked with '->'):
<xsd:complexType name="someTableRowType">
<xsd:sequence>
<xsd:element name="numberColumnInSomeTable" type="xsd:int" minOccurs="1" maxOccurs="1">
-> <xsd:attribute name="key" type="xsd:string" fixed="true"/>
</xsd:element>
<xsd:element name="stringColumnInSomeTable" type="xsd:string" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="someTableType">
<xsd:sequence>
<xsd:element name="someTableRowType" type="xsd:string" minOccurs="0" maxOccurs="unbound" />
</xsd:sequence>
</xsd:complexType>
// and then:
<xsd:complexType name="someOtherTableRowType">
<xsd:sequence>
<xsd:element name="numberColumnInSomeOtherTable" type="xsd:int" minOccurs="1" maxOccurs="1">
-> <xsd:attribute name="references" type="xsd:string" use="required"/>
</xsd:element>
<xsd:element name="stringColumnInSomeOtherTable" type="xsd:string" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="someOtherTableType">
<xsd:sequence>
<xsd:element name="someOtherTableRowType" type="xsd:string" minOccurs="0" maxOccurs="unbound" />
</xsd:sequence>
</xsd:complexType>
i am looking for the keywords for "key" and "references". is there something like that? or an other posibility exist?hi Ludek,
i want to provide additional information about the relations between the "tables" i provide. so that CR could be able to link these tables automaticly during the report creation. and i am looking for a possibility to define the primary- and foreignkey in the xsd.
what du you mean with "System.Data"? it seems to me you speak about .NET? i don't deal with .NET.
hi Bhushan,
your suggestion could help me by other problems i have. thank you.
temir -
Datasource for financial reporting structure
Hello,
I am extracting data from several finance datasources (FINGLAU*) to an external BW system. For several reporting requirements I need an extract of the so-called Financial Reporting Structures, which are effectively hierarchies of GL-accounts.
I have found a way to manually save these structures to an Excel-file through the Business Configuration work center. However I would like to automate this process by extracting these from a data source but I as of yet I have not been able to find one.
Does anyone know of a datasource to extract these structures?
Regards, DirkHello Dirk,
I am not sure if there is a data source for the financial reporting structure.
You can check help center document : Overview of Data Sources in SAP Business By Design
for the list of all available data sources.
Regards,
Harshal -
Unable to fill datatable to use as datasource for Crystal Report
Hello again kind folks of the Crystal Reports forums. I beseech you for a little assistance yet again. I am writing a program that does some very simple stuff, yet is giving me very complicated problems. I used the code I wrote from a working program and everything is fine, except the fact I can't get data on my report. I have created a dataset to get the data from my SQL Server database. The connection string I have works, and the query I use works. In my other program I when I look at the dataset.xsd I see a filled datatable and that was how I got my fields for the report. In this one, I don't know how to prefill the datatable so that I can use that as a datasource in my report. I would be glad to get you code if anyone would like it. If someone could explain to me how to fill the datatable so I can use it as the crystal datasource, I would be so appreciative.
Thanks again for all your help.
Jami BensonThanks for posting a reply Amit. I am confused about a couple things. The XML file. Is that something that I have to create myself? In my last program I got around using XML files somehow and for the life of me I can't remember how I did it. Is there another way you know of to fill besides this? Also I dont' have access on my computer. The boss never say a need since no one uses it. Is there a way to use my code, which I'm gonna include, and do it??
Many thanks again Amit!
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
namespace SeriesPublishedToWeb
public partial class Form1 : Form
#region Configurable Settings
private string connectionString = "Data Source =SQLSERVER; User ID=NightOps; Password=BTSB; Initial Catalog =BTSB";
#endregion
public Form1()
InitializeComponent();
private void runReport_Click(object sender, EventArgs e)
CrystalReport1 crReportDocument = new CrystalReport1();
BTSBDataSet dataSet = new BTSBDataSet();
using (SqlConnection conn = new SqlConnection(connectionString))
try
conn.Open();
catch (SqlException Ex)
if (conn != null)
conn.Dispose();
string ErrorMessage = "A error has occured while trying to connect to the server.";
ErrorMessage += Environment.NewLine;
ErrorMessage += Environment.NewLine;
ErrorMessage += Ex.Message;
MessageBox.Show(this, ErrorMessage, "Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
string SQLSTATEMENT = "select t.titleno, title, season_code, series, field " +
"from btsblog b JOIN TMASTER t on b.selectionid = t.titleno JOIN TMASTEREXT e on e.titleno = t.titleno " +
"where timestamp >= '3/1/09' " +
"and timestamp <= '4/3/09' " +
"and field = 'Publishtoweb' " +
"and datawas = 'N' " +
"and datais = 'Y' " +
"and season_code = 'B' " +
"and series <> ' '";
using (SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQLSTATEMENT, conn))
// this is the dataset that will fill the data adapter
SQLDataAdapter.Fill(dataSet.Tables["BTSBDataTable"]);
//this should launch the crystal on form 2
crReportDocument.SetDataSource(dataSet);
//show the crystal
frmCrystal reportViewer = new frmCrystal(crReportDocument);
reportViewer.Refresh();
reportViewer.ShowDialog(); -
How can I set default copies for specific report?
I'm trying to set a default of one copy on a specific concurrent request. In this particular case, the NACHA request that produces the NACHA magnetic file. I have a dummy custom printer driver, style, etc. setup and attached to the NACHA concurrent program so that when it executes (as long as the user remembers to put 1 in the Copies field on the concurrent request screen) it will execute the Unix shell script (it grabs the file and FTP's it somewhere).
The problem is, if the user forgets to put 1 in Copies, the Unix shell script won't execute. I'd like to make it so this one request comes up with a default of 1 in Copies. The only way I know of to set copies is in the site profile, application profile (like HR, AP, etc.) or user profile. I really don't want any of these because then the default will be set for all reports within those respective profiles. I was hoping there was a way to set the number of copies in the printer control file, but thus far I can't find any current documentation that shows the syntax of the available commands for the printer control file. Found something on the Internet, but it looked like it was for Oracle 7, perhaps. We're on 11i. On that page, I saw nothing about setting copies, so I don't know if it was just missed, isn't possible or is possible in the new version.Looks like I may have found my answer.
Create a report set
Add the concurrent program to the report set
set copies in the options zone of the report set to 1
Run the report set instead of the concurrent program itself and the copies will always be defaulted to 1. -
How to use a table- valued function as a datasource for SSRS report?
CREATE FUNCTION [dbo].[GetNetSheetRegionNetPerCapitaRow](@WeekBeginDate smalldatetime)
RETURNS @RegionNetPerCapitaRow TABLE
(WTD1 DECIMAL(18,6),PYWTD1 decimal(18,6),percentDiff1 float,diff1 float,WTD2 decimal(18,6),YTD2 decimal(18,6),percentDiff2 float,Diff2 float,YTD3 decimal(18,6),PYTD3 decimal(18,6),percentDiff3 float,Diff3 float)
how to use the above function as a data source for SSRS report instead of a stored procedure ?Hi,
In the Dataset - > Query Type - > Text - >
SELECT * FROM [dbo].[GetNetSheetRegionNetPerCapitaRow](@WeekBeginDate)
sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **. -
Is there a Data Model in BW for Financial Reporting?
Hi,
I am required to integrate a non-SAP Financial application to SAP BW. I am wondering if there exists a Data Model in SAP BW that supports out of the box canned reports. This will help me target the interface design to feed the existing Data Model. Any pointers to this Data Model and list of canned reports would be very helpful.
Thanks,
NitinHave you looked at the BI content:
http://help.sap.com/saphelp_nw04/helpdata/EN/65/7beb3cad744026e10000000a11405a/frameset.htm
This will link to an R3 backend but it will give you an idea of what can be done? -
Error after migration to Crystal Reports 12 for existing reports
Hi,
We had reports written using Crystal Reports Version 8.5. These reports were not modified for a long time. Recently, we had migrated to Crystal Reports 12 (2008). Some of the these existing reports were modified using the Crystal Reports 2008 designer. After installing our application (we ship Merge Module of Crystal Reports 12 i.e. 2008 which gets installed in GAC)
1) If we create new reports in 2008 designer and try to view these reports, it works as expected without any issue(s).
2 ) However, if these modified reports are tried to be viewed, there is an error which states "Database Logon Failed".
Details:
CrystalDecisions.CrystalReports.Engine.LogOnException {"Database logon failed."}
ErrorID CrystalDecisions.CrystalReports.Engine.EngineExceptionErrorID.LogOnFailed
InnerException {"Database logon failed."}
Message "Database logon failed."
Source "CrystalDecisions.ReportAppServer.DataSetConversion"
Stack Trace at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)
TargetSite {Boolean ThrowDotNetException(System.Exception)}
Also, it is worth to note that if we try to view these modified reports from any environment which has both Crystal Reports 10 and Crystal Reports 12 in GAC, then these reports work as expected.
P.S. We have mechanism in application's code to reset the database connections when any report is being viewed using ReportDocument class' method.
From the above scenario I believe issue is specific to migration to Crystal Reports 12 (2008). Any help /workaround to solve this problem will be highly appreciated.Make sure you have the latest SP for CR 2008 installed;
https://smpdl.sap-ag.de/~sapidp/012002523100009038092009E/cr2008win_sp2.exe
Ensure you are deploying SP 2 runtime;
MSM
https://smpdl.sap-ag.de/~sapidp/012002523100009159092009E/cr2008sp2_mm.zip
MSI
https://smpdl.sap-ag.de/~sapidp/012002523100009159002009E/cr2008sp2_redistinstall.zip
If that does not help;
1) Do these reports work in the designer?
2) What database are you using and what is the connection type?
3) Compare the dlls loading on the systems where this app works (environment which has both Crystal Reports 10 and Crystal Reports 12 in GAC) and a system that is giving you the error. Use the [Modules|https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip] utility.
4) Open the reports in the designer and look at the properties in the Database menu -> Set Datasource Location. Check to see if there are any differences between the two reports.
5) If there is a subreport in the report that causes the issue, remove it and see if the report works without the subreport.
Ludek -
Change Selection criteria for existing report in Report painter
Hi Experts,
We are on 4.7, using report painter for getting reports for Cost center & Profit Center. For one of the report we have selection criteria as Cost center and cost center group, but now user want us to add new selection field as Cost element and cost element Group to same report. We have tried all the options from GR32 ->Edit-> General Selection, but we don't find cost element in Key figure listed there.
Please let us know how can we add the new field to selection criteria. We also would like to know is this is possible with existing report to add new fields or not? Is that we need to create new report for this?
Thanks in advance..
ShilpaShilpa-
In my opinion the best way to troubleshoot issues like this is to go to SAP delivered standard reports and see how they are setup. For example, in your case you want to add cost element and cost element group to your report. There is one standard report from SAP - Transaction :S_ALR_87013611 which has both cost center, cost center group and cost element, cost element group in the selection criteria. You can look how this report is set up, and maintain your report in a similar fashion. Atleast this way, it will give you an idea.
Go to transaction code GRR3 and under library look for report "1SIP-001". By double clicking on the row, you will see how it is maintained.
Hope this helps.
Shail -
Replace Report Model with another Report Model for existing reports
Hi All,
I have a report model on which few reports depends and for some reasons I want create a similar report model and repoint all existing reports to new report model. When I am trying to this I get below error. Please help.
An error has occurred during report processing. (rsProcessingAborted)
Semantic query compilation failed: e EmptySemanticQuery The SemanticQuery does not contain any Groupings or MeasureGroups. SemanticQuery must contain at least one of these elements. This typically occurs because the user does not have permission to the items
referenced by the query or the items referenced by the query have been deleted in the underlying model. (SemanticQuery ''). (rsSemanticQueryEngineError)
Thanks,
JithenderThe reports that do work do not use an alias for the table/view name and the ones that do NOT work do use an alias.<br/>
<br/>
I went into the "Database Expert..." screen and modified the alias to the actual name of the view. This resets all the fields as well so they are no longer using the alias either. The data now gets returned properly.<br/>
<br/>
I still need to go into each report and modify them but at least I do not have to recreated all the reports. -
Find workbench request for existing report
Hi
Someone created an Report for me in order to develop some new functionalities.i have to transport it now in the test system but i do not know how i can find the workbench request for it or how i can save it in another workbench request.
thanksHi Seba ,
You can find the workbench request for the report by displaying the report and following this path in the menubar.
Utilities > version > version management.
If you want to add this request into another request goto SE01 and there you will find the icon for adding the objects for your request.
Regards,
Anuj -
Setting up datasource for MS SQL SERVER 2005 Express
Can anyone offer me a little help
I have SQL 2005 Express Edition installed on the same machine
as CF
I've been into it and enabled TCP/IP and NAMED PIPES
I've set TCP port to 1433
I've created a login account called CF and enabled both SQL
and Windows authentication
I've created a database called coldfusionDB
I've set windows firewall to make an exception for that port
In CF Administrator I'm using the supplied Microsoft SQL
driver. Can someone tell me what to put in the fields for the
datasource ? I have the following:
Port = 1433
DATABASE = coldfusionDB
SERVER = DESKTOP\SQLEXPRESS
the Error I'm getting back from CF Administrator is:
* Connection verification failed for data source:
cfclientstore
java.sql.SQLException: [Macromedia][SQLServer JDBC
Driver][Macromedia][SQLServer JDBC Driver]The requested instance is
either invalid or not running.
The root cause was that: java.sql.SQLException:
[Macromedia][SQLServer JDBC Driver][Macromedia][SQLServer JDBC
Driver]The requested instance is either invalid or not running.Try:
Server = localhost\sqlexpress
Database = coldfusionDB
Port = 1433
Also verify that the SQL server service has started.
These links may also help:
http://www.adobe.com/go/kb400255
http://www.mattwoodward.com/blog/index.cfm?event=showEntry&entryID=01930619-FD0A-4F02-31B1 BFC7D1D9A44C
Maybe you are looking for
-
Postfix doesn't recognize my domain
I'm setting up postfix so I can send mail from an SMF forum on a dedicated mac mini with a static IP address. Following the instructions in the postfix.org documentation I've set mydomain = <mydomainname>.com where <mydomainname> is as in www.<mydoma
-
Select distinct a.forename as "Name", a.surname as "Surname", a.forename ||''||a.surname as "Fullname", b.ancestors as "Ancestors", Other columns .. from table1 a,table2 b,table3 c,table4 d... where a.col1 =b.col1 and ..(other conditions) Output is a
-
Sharing photos with descriptions
I'm trying to share my photos with captions. How do you do this? (via flikr or mobile me websites?)
-
Mysql distinct search for one column
I would like to use an SQL query to return from a database the first occurence of a data value (DUT's serial number). I have a database that contains the DUT serial number, the test status (i.e. pass or fail), and the date the DUT was tested. Since I
-
I do not have app store built into my new i phone
I do not have app store built into my new i phone