Friday, March 30, 2012
help in crystal report & dataset
In my application I have 2 form named Form1 and Form2.
I create one dataset named ds in Form1 and in Form2 I want to creat a crystal report that displays the data in the dataset ds in Form1.
I relly get stuck.Can anyone help me?
Thanx b4 hand!See if you find answer here
www.asp.net
http://support.businessobjects.com/sql
Monday, March 26, 2012
Help Filling Dataset
I have a class that works fine using the SQLDataReader but when I try and duplicate the process using a Dataset instead of a SQLDataReader it returnsa a null value.
This is the code for the Method to return a datareader
public
SqlDataReader GetOrgID(){
Singleton s1 =Singleton.Instance();
Guid uuid;
uuid =
newGuid(s1.User_id);SqlConnection con =newSqlConnection(conString);
string selectString ="Select OrgID From aspnet_OrgNames Where UserID = @.UserID";
SqlCommand cmd =newSqlCommand(selectString, con);
cmd.Parameters.Add(
"@.UserID",SqlDbType.UniqueIdentifier, 16).Value = uuid;
con.Open();
SqlDataReader dtr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
return dtr;
This is the code trying to accomplish the same thing with a Dataset instead.
publicDataSet organID(DataSet dataset)
{
Singleton s1 =Singleton.Instance();
Guid uuid;
uuid =
newGuid(s1.User_id);string queryString ="Select OrgID From aspnet_OrgNames Where UserID = @.UserID";
SqlConnection con =newSqlConnection(conString);
SqlCommand cmd =newSqlCommand(queryString, con);
cmd.Parameters.Add(
"@.UserID",SqlDbType.UniqueIdentifier, 16).Value = uuid;
SqlDataAdapter adapter =newSqlDataAdapter();
adapter.SelectCommand = cmd;
adapter.Fill(dataset);
return dataset;
}
Assume that the conString is set to a valid connection string. The Singlton passes the userid in from some code in the code behind page ...this functionality works as well.
So assume that the Guid is a valid entry..I should return a valid dataset but its null.
Additionally if I change the sql query to just be Select * From aspnet_OrgNames I still get a null value...I am assuming I am doing something wrong trying to fill the dataset.
Any help would be appreciated.
Hi,
Are you passing in a valid dataset which is not null?
include a ' dataset = new DataSet(); ' before you fill in the data and check if it works
if it does, it just means you passed in a null value...
Thank you, Thank you, Thank you!!!
VERY MUCH APPRECIATED!!!
Wednesday, March 7, 2012
HELP - Running a Report with Dynamic Query from a web page
or all records from the dataset to display.The query looks like this
="SELECT abunch of fieds" &
"FROM a view" &
iif(Parameters!orgid.value = 0,"","WHERE organization_id = " &
Parameters!orgid.value)
Essentially if the report parameter (orgid) = 0 then get all records, if
it's something other than 0, get the specified record.
The report is called from an ASP web application which builds the required
URL depending on the organization selected. The URL looks like this:
"http://webserver/reporting/pages/report.aspx?ItemPath=pathtoreport/report&rc:Parameters=false&orgid=123
In the browser, the HTML (I guess) viewer opens, displays the Parameter bar,
prompts me for a orgid and sits there.
I don't want the Parameter bar to show, just run the report with the
parameter supplied in the url. What am I doing wrong' Or what am I not doing
right?You have set up the beginning of the url incorrectly.
It should look like this:
http://webserver/reportserver?/pathToReport/ReportName&rc:Parameters=false&orgid=123
See the following msdn article for details:
http://msdn2.microsoft.com/en-us/library/ms152835.aspx
Rowen McDermott|||Ah Rowen, if only it were so easy and straightforward. BTW, thanks for the
reply.
When I use the method described by MS and everybody else who wrote a book on
Reporting Services, this is what happens:
I'm re-directed to the reportserver home page with a URL of
http://<webserver>/<reportserver>/Pages/Folder.aspx. I can see the folder
that contains the report to run, I have an administrative Toolbar and that's
pretty much it. If I browse down to the report, I can click on it, the report
will start and prompt me for an orgid.
Have any other suggestions? I've got the sa who set up Reporting Services
checking on her end to see if she can get the report to run as advertised.
Thanks again.
The only way I've gotten the report to start is the method I first described.
"Rowen" wrote:
> You have set up the beginning of the url incorrectly.
> It should look like this:
> http://webserver/reportserver?/pathToReport/ReportName&rc:Parameters=false&orgid=123
> See the following msdn article for details:
> http://msdn2.microsoft.com/en-us/library/ms152835.aspx
> Rowen McDermott
>|||On Mar 20, 11:15 pm, JoeKoko <JoeK...@.discussions.microsoft.com>
wrote:
> Ah Rowen, if only it were so easy and straightforward. BTW, thanks for the
> reply.
> When I use the method described by MS and everybody else who wrote a book on
> Reporting Services, this is what happens:
> I'm re-directed to the reportserver home page with a URL of
> http://<webserver>/<reportserver>/Pages/Folder.aspx. I can see the folder
> that contains the report to run, I have an administrative Toolbar and that's
> pretty much it. If I browse down to the report, I can click on it, the report
> will start and prompt me for an orgid.
> Have any other suggestions? I've got the sa who set up Reporting Services
> checking on her end to see if she can get the report to run as advertised.
> Thanks again.
> The only way I've gotten the report to start is the method I first described.
>
In that case I'm afraid I cant help you. The method I described above
worked for me, so I can't say what is going on in your case.
I would suggest testing a very basic report with no parameters using
the microsoft documented method and see if it displays the report or
re-directs you to the report server home page.
Regards,
Rowen
Monday, February 27, 2012
Help - Error when modifying dataset
the code for the report. then I pasted my new code in and adjusted all the
fields in the layout to respond to the new fields. But I can't get it to
Preview - I keep getting this error message.
The SortExpresssion expression for the table â'table1â' refers to the field
â'projectâ'. Report item expressions can only refer to fields within the
current data set scope or, if inside an aggregate, the specified data set
scope
Can anyone tell me how to correct this information to use my new code?
Thank you
Normad"NormaD" wrote:
> I keep getting this error when I go to Preview the report. I have changed
> the code for the report. then I pasted my new code in and adjusted all the
> fields in the layout to respond to the new fields. But I can't get it to
> Preview - I keep getting this error message.
> The SortExpresssion expression for the table â'table1â' refers to the field
> â'projectâ'. Report item expressions can only refer to fields within the
> current data set scope or, if inside an aggregate, the specified data set
> scope
> Can anyone tell me how to correct this information to use my new code?
> Thank you
> Normad
Thanks to any of you who were reading this to respond. I went into the XML
and did the changes.
normad