Showing posts with label service. Show all posts
Showing posts with label service. Show all posts

Wednesday, March 28, 2012

How to create locialized report?

I know the language displayed on reporting service is based on language preference on IE, so I have no porblem on that.

But, is there any method to control the report itself? Can I use a resource control thing? or anything else to control it? so that when IE is displaying Chinese big5, the reoprt header and column header can display Chinese big5, and it goes the same for English and so on

Many thx

Yes - You can change the STYLE properties for any element and set the culture field to whatever you want.

Monday, March 26, 2012

How to create internet connection?

Hi everybody,
Is there a client side approach of sending and receiving data from a sql database without a web service or a server component (servicedcomponent and server app)? How can you simulate a network connection over the internet that could send and receive data from and to database?

How can you create a class that would do the same task as a network connection using internet communication as medium? Please point me to topics and documents about this matter.

Thanks.

denpsia

SQLServer provides this feature.

I move this post.

|||

In .NET you would use the HttpWebRequest class, here is a simple bit of sample code to send a SOAP packet.

private void soapRequest()
{
Uri soapUri = new Uri("http://" + soapServer + "/clear_integrated");
string soapRequest =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
"xmlns:sql=\"http://schemas.microsoft.com/sqlserver/2004/SOAP\">" +
"<SOAP-ENV:Body>" +
"<sql:sqlbatch>" +
"<sql:BatchCommands>" +
"select * from authors" +
"</sql:BatchCommands>" +
"</sql:sqlbatch>" +
"</SOAP-ENV:Body>" +
"</SOAP-ENV:Envelope>";

System.Text.UTF8Encoding utfEncoder = new UTF8Encoding();
byte [] requestBytes = utfEncoder.GetBytes(soapRequest);

// Do the work.
for(int i=1; i<=loopCount; i++)
{
try
{
HttpWebRequest webRequest = (System.Net.HttpWebRequest)WebRequest.Create(soapUri);
webRequest.Credentials = System.Net.CredentialCache.DefaultCredentials;
webRequest.Timeout = timeout;
webRequest.KeepAlive = true;
webRequest.Headers.Add("SOAPAction", "\"http://schemas.microsoft.com/sqlserver/2004/SOAPsqlbatch\"");
webRequest.ContentType = "text/xml;charset=\"utf-8\"";
webRequest.Accept = "text/xml";
webRequest.Method = "POST";
webRequest.ContentLength = requestBytes.Length;
Stream requestStream = webRequest.GetRequestStream();
requestStream.Write(requestBytes, 0, requestBytes.Length);
requestStream.Close();
WebResponse webResponse = webRequest.GetResponse();

StreamReader responseStream =
new System.IO.StreamReader(webResponse.GetResponseStream(), Encoding.UTF8);

string stringResponse = responseStream.ReadToEnd();
responseStream.Close();
webResponse.Close();

if (1445 != stringResponse.Length) failCount++;

}
catch (Exception ex)
{
logex(ex);

}
}
}

|||

Hi Matt,

This topic is quite old. Thanks for the reply, at that time I post this topic, I am working on windows application on a tablet pc that needs internet connection and remote access to a remote MySQL database. This code of yours is for asp.net and how exactly would the data be transmitted? What protocol or utility would handle the actual sending of data, in my work then we uses VPN to establish remote database connection and ras dialup to establish internet connection. Thanks for the code, it might proved useful next time.

den2005

How to create internet connection?

Hi everybody,
Is there a client side approach of sending and receiving data from a sql database without a web service or a server component (servicedcomponent and server app)? How can you simulate a network connection over the internet that could send and receive data from and to database?

How can you create a class that would do the same task as a network connection using internet communication as medium? Please point me to topics and documents about this matter.

Thanks.

denpsia

SQLServer provides this feature.

I move this post.

|||

In .NET you would use the HttpWebRequest class, here is a simple bit of sample code to send a SOAP packet.

private void soapRequest()
{
Uri soapUri = new Uri("http://" + soapServer + "/clear_integrated");
string soapRequest =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
"xmlns:sql=\"http://schemas.microsoft.com/sqlserver/2004/SOAP\">" +
"<SOAP-ENV:Body>" +
"<sql:sqlbatch>" +
"<sql:BatchCommands>" +
"select * from authors" +
"</sql:BatchCommands>" +
"</sql:sqlbatch>" +
"</SOAP-ENV:Body>" +
"</SOAP-ENV:Envelope>";

System.Text.UTF8Encoding utfEncoder = new UTF8Encoding();
byte [] requestBytes = utfEncoder.GetBytes(soapRequest);

// Do the work.
for(int i=1; i<=loopCount; i++)
{
try
{
HttpWebRequest webRequest = (System.Net.HttpWebRequest)WebRequest.Create(soapUri);
webRequest.Credentials = System.Net.CredentialCache.DefaultCredentials;
webRequest.Timeout = timeout;
webRequest.KeepAlive = true;
webRequest.Headers.Add("SOAPAction", "\"http://schemas.microsoft.com/sqlserver/2004/SOAPsqlbatch\"");
webRequest.ContentType = "text/xml;charset=\"utf-8\"";
webRequest.Accept = "text/xml";
webRequest.Method = "POST";
webRequest.ContentLength = requestBytes.Length;
Stream requestStream = webRequest.GetRequestStream();
requestStream.Write(requestBytes, 0, requestBytes.Length);
requestStream.Close();
WebResponse webResponse = webRequest.GetResponse();

StreamReader responseStream =
new System.IO.StreamReader(webResponse.GetResponseStream(), Encoding.UTF8);

string stringResponse = responseStream.ReadToEnd();
responseStream.Close();
webResponse.Close();

if (1445 != stringResponse.Length) failCount++;

}
catch (Exception ex)
{
logex(ex);

}
}
}

|||

Hi Matt,

This topic is quite old. Thanks for the reply, at that time I post this topic, I am working on windows application on a tablet pc that needs internet connection and remote access to a remote MySQL database. This code of yours is for asp.net and how exactly would the data be transmitted? What protocol or utility would handle the actual sending of data, in my work then we uses VPN to establish remote database connection and ras dialup to establish internet connection. Thanks for the code, it might proved useful next time.

den2005

sql

Monday, March 19, 2012

How to create a report using multiple databases

Hi, I am a beginner of Reporting Service. I am trying to create a report using multiple databses. For example, I want to create a report called RevenueByCustomer, so I need to get data from the Customer Table of CRM database, which contains customer information, and I also need to get data from Transaction table of Sales database, which contains all the revenue information. In order to get data from both database, I have created two dataset. One is Customer dataset, which get all required customer data from CRM database, and the other is Revenue dataset, which gets data from Sales database, they used seperate datasource (because each datasource only contains one database connection). Now my problem is how can I make them be displayed in one report ? It seems to be like a Master-Detail report, I need to sum up all trasactions for a particular customer and also need to display the customer name with each TotalAmount, but how can I make these two dataset can be merged together or used an extra query to do it?

Please help me, thanks a lot

This Query below is used to calculate the total amount for each customer in Revenue dataset:

SELECT CustomerID, sum(TotalAmount - TotalTaxAmount) AS TotalExcTax, sum(TotalAmount) AS TotalIncTax
FROM TransactionMaster
WHERE (Updated >= @.Start) AND (Updated <= @.End)
Group By CustomerID

the other one here is used to get customer code and name in Customer dataset:

SELECT ID, Code, Name
FROM Customer

SELECT ID, Code, Name
FROM Customer

UNION ALL

SELECT CustomerID, sum(TotalAmount - TotalTaxAmount) AS TotalExcTax, sum(TotalAmount) AS TotalIncTax
FROM TransactionMaster
WHERE (Updated >= @.Start) AND (Updated <= @.End)
Group By CustomerID

|||

I think your easiest solution would be to join the two recordset's together via the CustomerID and put it in one dataset. Then you can have Reporting Services do the grouping.

SELECT c.Code, c.Name, sum(t.TotalAmount - t.TotalTaxAmount) AS TotalExcTax, sum(t.TotalAmount) AS TotalIncTax
FROM CustomerDB.dbo.Customer c
inner join SalesDB.dbo.TransactionMaster t on c.ID = t.CustomerID
WHERE (t.Updated >= @.Start) AND (t.Updated <= @.End)

Hope this helps.

Jarret

|||


Hi,

You might be able to do that on the SQL server and return that as a view, but you can't access two separate database connections in the SQL statement in the RS dataset designer. (unless this has changed..)

If you want to create a master - detail report in BIDS, try creating two connections, two seperate datasets and then create a 'master' report on one dataset and a subreport for the detail on the other dataset. Then pass that subreport the current master record's ID field using parameters..

pl

|||

pl,

You can join from other databases as in my example. I think I mis-worded it, instead of '...join the two recordset's together via...', I should have said '...join the two table's together via...'.

Sorry for the confusion. I still think this would be the easiest solution, rather than creating sub-reports.

Jarret

|||

Hi Jarret,

I don't believe you can join two tables from different databases in SQL dataset editor in BIDS. Have you ever tried?

pl

|||

pl,

Yes, I have tried, and it works (as long as the user account has access to both databases). I have a few reports in production that link between databases.

Jarret

|||

Hi Jarret,

Really? Which version of RS are you using? I have RS 2005 (no upgrades to sp1..) and BIDS (SQL Server Business Intelligence Development Studio). Even though I create two connections to two databases in a solution using BIDS, I cannot refer to 'the other database' in the SQL view designer when I'm creating a new dataset.

Is this post correct: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=177599&SiteID=1

Here is what I do:

1) Create a new Report Server Project in BIDS 2005

2) Add a datasource to the Shared Data Sources. Hook it up to database1.

3) Add another datasource to the Shared Data Sources. Hook it up to database2. Now you have two datasources in one report project.

4) Add a report.

5) Create a new dataset. (Click on the "Data" tab, hit the drop-down list and choose <new dataset>) Notice that when that dataset dialog opens up, you can only specify one datasource for it. Specify the datasource.

6) In the dataset designer, try to access the other datasource that you did not specify in the dataset's connection (ie: select * from database2.dbo.table1) . It doesn't work. You get an error message that says "Invalid object name... Error: 208"

You are saying that this works for you? Are you sure you aren't maybe doing this in query analyzer on the server and producing a view which you then use to populate a datasource in RS using only one connection?

pl

|||

pl,

I think you misunderstand what I have done (and suggested) here. I am using RS 2005 SP1 and BIDS. In my example, the code I pasted (below) was the query for 1 single dataset. Of course, if these databases are on separate servers, this wouldn't be possible without a linked server. However, Fern.Andy didn't mention anything about the DB's being on separate servers, so I assumed they weren't.

SELECT c.Code, c.Name, sum(t.TotalAmount - t.TotalTaxAmount) AS TotalExcTax, sum(t.TotalAmount) AS TotalIncTax
FROM CustomerDB.dbo.Customer c
inner join SalesDB.dbo.TransactionMaster t on c.ID = t.CustomerID
WHERE (t.Updated >= @.Start) AND (t.Updated <= @.End)

I am not saying that I can link two dataset's together from within BIDS. In short, I joined the two tables together in the query, rather than trying to get RS to join two different datasets.

1. Create a new report
2. Create the connection string to the server
3. Paste the above query into the query string

Jarret

|||

Hey Jarret,

I've got it working now. Thank you very much. I appreciate your patience.

Seems I had a spelling mistake in the database name. Once I had that fixed, I had to give access to the same user to the second database. But, it does work now. And, I only needed one connection in RS. This is going to be a very handy. Much better than using sub-reports.

Thanks again.

pl

How to create a report using multiple databases

Hi, I am a beginner of Reporting Service. I am trying to create a report using multiple databses. For example, I want to create a report called RevenueByCustomer, so I need to get data from the Customer Table of CRM database, which contains customer information, and I also need to get data from Transaction table of Sales database, which contains all the revenue information. In order to get data from both database, I have created two dataset. One is Customer dataset, which get all required customer data from CRM database, and the other is Revenue dataset, which gets data from Sales database, they used seperate datasource (because each datasource only contains one database connection). Now my problem is how can I make them be displayed in one report ? It seems to be like a Master-Detail report, I need to sum up all trasactions for a particular customer and also need to display the customer name with each TotalAmount, but how can I make these two dataset can be merged together or used an extra query to do it?

Please help me, thanks a lot

This Query below is used to calculate the total amount for each customer in Revenue dataset:

SELECT CustomerID, sum(TotalAmount - TotalTaxAmount) AS TotalExcTax, sum(TotalAmount) AS TotalIncTax
FROM TransactionMaster
WHERE (Updated >= @.Start) AND (Updated <= @.End)
Group By CustomerID

the other one here is used to get customer code and name in Customer dataset:

SELECT ID, Code, Name
FROM Customer

SELECT ID, Code, Name
FROM Customer

UNION ALL

SELECT CustomerID, sum(TotalAmount - TotalTaxAmount) AS TotalExcTax, sum(TotalAmount) AS TotalIncTax
FROM TransactionMaster
WHERE (Updated >= @.Start) AND (Updated <= @.End)
Group By CustomerID

|||

I think your easiest solution would be to join the two recordset's together via the CustomerID and put it in one dataset. Then you can have Reporting Services do the grouping.

SELECT c.Code, c.Name, sum(t.TotalAmount - t.TotalTaxAmount) AS TotalExcTax, sum(t.TotalAmount) AS TotalIncTax
FROM CustomerDB.dbo.Customer c
inner join SalesDB.dbo.TransactionMaster t on c.ID = t.CustomerID
WHERE (t.Updated >= @.Start) AND (t.Updated <= @.End)

Hope this helps.

Jarret

|||


Hi,

You might be able to do that on the SQL server and return that as a view, but you can't access two separate database connections in the SQL statement in the RS dataset designer. (unless this has changed..)

If you want to create a master - detail report in BIDS, try creating two connections, two seperate datasets and then create a 'master' report on one dataset and a subreport for the detail on the other dataset. Then pass that subreport the current master record's ID field using parameters..

pl

|||

pl,

You can join from other databases as in my example. I think I mis-worded it, instead of '...join the two recordset's together via...', I should have said '...join the two table's together via...'.

Sorry for the confusion. I still think this would be the easiest solution, rather than creating sub-reports.

Jarret

|||

Hi Jarret,

I don't believe you can join two tables from different databases in SQL dataset editor in BIDS. Have you ever tried?

pl

|||

pl,

Yes, I have tried, and it works (as long as the user account has access to both databases). I have a few reports in production that link between databases.

Jarret

|||

Hi Jarret,

Really? Which version of RS are you using? I have RS 2005 (no upgrades to sp1..) and BIDS (SQL Server Business Intelligence Development Studio). Even though I create two connections to two databases in a solution using BIDS, I cannot refer to 'the other database' in the SQL view designer when I'm creating a new dataset.

Is this post correct: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=177599&SiteID=1

Here is what I do:

1) Create a new Report Server Project in BIDS 2005

2) Add a datasource to the Shared Data Sources. Hook it up to database1.

3) Add another datasource to the Shared Data Sources. Hook it up to database2. Now you have two datasources in one report project.

4) Add a report.

5) Create a new dataset. (Click on the "Data" tab, hit the drop-down list and choose <new dataset>) Notice that when that dataset dialog opens up, you can only specify one datasource for it. Specify the datasource.

6) In the dataset designer, try to access the other datasource that you did not specify in the dataset's connection (ie: select * from database2.dbo.table1) . It doesn't work. You get an error message that says "Invalid object name... Error: 208"

You are saying that this works for you? Are you sure you aren't maybe doing this in query analyzer on the server and producing a view which you then use to populate a datasource in RS using only one connection?

pl

|||

pl,

I think you misunderstand what I have done (and suggested) here. I am using RS 2005 SP1 and BIDS. In my example, the code I pasted (below) was the query for 1 single dataset. Of course, if these databases are on separate servers, this wouldn't be possible without a linked server. However, Fern.Andy didn't mention anything about the DB's being on separate servers, so I assumed they weren't.

SELECT c.Code, c.Name, sum(t.TotalAmount - t.TotalTaxAmount) AS TotalExcTax, sum(t.TotalAmount) AS TotalIncTax
FROM CustomerDB.dbo.Customer c
inner join SalesDB.dbo.TransactionMaster t on c.ID = t.CustomerID
WHERE (t.Updated >= @.Start) AND (t.Updated <= @.End)

I am not saying that I can link two dataset's together from within BIDS. In short, I joined the two tables together in the query, rather than trying to get RS to join two different datasets.

1. Create a new report
2. Create the connection string to the server
3. Paste the above query into the query string

Jarret

|||

Hey Jarret,

I've got it working now. Thank you very much. I appreciate your patience.

Seems I had a spelling mistake in the database name. Once I had that fixed, I had to give access to the same user to the second database. But, it does work now. And, I only needed one connection in RS. This is going to be a very handy. Much better than using sub-reports.

Thanks again.

pl

Friday, March 9, 2012

How to create a dropdown list on report?

I would like to create a first dropdown list on my report. How can I do that?
I am using followings,
Reporting service (SQL Server 2005 June CTP release)
Steps which I am following to create a report,
1. Creating a model using BIDS and publishing it to Report Server
2. By using Report Builder, I am creating new report and storing it on
Report server. In one of my report, I would like to display dropdown list for
Project with "Project Name". At present, I am using filter criteria for
displaying parameter on each report but it is only displaying text field.
I am still searching related post here and expecting help...
Thnks
--
There is a light on the other side, Keep walking.Try these steps. Step number 3 is the key item here.
1. Open the Filter dialog
2. Add a entity or field to the filter layout area
3. Click on the entity or field name. This will open a context menu. Select
the 'Prompt' option
4. Click on the filter condition. This will open a context menu. Select the
'In a List' option
5. Click the filter value dropdown. You can pre select values to display or
leave all items unchecked.
6. Run the report. You should see dropdown that contains a list of parameter
values.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Nilesh Trivedi" <NileshTrivedi@.discussions.microsoft.com> wrote in message
news:4D0A8262-1594-4A5B-B06E-2A51401307AF@.microsoft.com...
>I would like to create a first dropdown list on my report. How can I do
>that?
> I am using followings,
> Reporting service (SQL Server 2005 June CTP release)
> Steps which I am following to create a report,
> 1. Creating a model using BIDS and publishing it to Report Server
> 2. By using Report Builder, I am creating new report and storing it on
> Report server. In one of my report, I would like to display dropdown list
> for
> Project with "Project Name". At present, I am using filter criteria for
> displaying parameter on each report but it is only displaying text field.
> I am still searching related post here and expecting help...
> Thnks
> --
> There is a light on the other side, Keep walking.|||Yes, I achieved so far. But my question is still open.
Consider following scenario,
Report designer - will create a report with selected dropdown items using
filter criteria <Fieldname> <in a list> <Item selected>. This field
<fieldname> is checked as prompt which will display parameter in a report
while running a report.
N.B.: As you are saying in your previous reply.
Report user - will run this report and will see only preselected <Item
Selected> by the Report Designer.
My query is to make more flexible to Report user so that Report user can
select any dropdown items. So on Report, Report user will have dropdown list
instead of simple textbox.
--
There is a light on the other side, Keep walking.
"Bruce Johnson [MSFT]" wrote:
> Try these steps. Step number 3 is the key item here.
> 1. Open the Filter dialog
> 2. Add a entity or field to the filter layout area
> 3. Click on the entity or field name. This will open a context menu. Select
> the 'Prompt' option
> 4. Click on the filter condition. This will open a context menu. Select the
> 'In a List' option
> 5. Click the filter value dropdown. You can pre select values to display or
> leave all items unchecked.
> 6. Run the report. You should see dropdown that contains a list of parameter
> values.
> --
> Bruce Johnson [MSFT]
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Nilesh Trivedi" <NileshTrivedi@.discussions.microsoft.com> wrote in message
> news:4D0A8262-1594-4A5B-B06E-2A51401307AF@.microsoft.com...
> >I would like to create a first dropdown list on my report. How can I do
> >that?
> > I am using followings,
> > Reporting service (SQL Server 2005 June CTP release)
> > Steps which I am following to create a report,
> > 1. Creating a model using BIDS and publishing it to Report Server
> > 2. By using Report Builder, I am creating new report and storing it on
> > Report server. In one of my report, I would like to display dropdown list
> > for
> > Project with "Project Name". At present, I am using filter criteria for
> > displaying parameter on each report but it is only displaying text field.
> >
> > I am still searching related post here and expecting help...
> > Thnks
> >
> > --
> > There is a light on the other side, Keep walking.
>
>|||I achieved my query by doing followings,
1. Create a basic report using Report Builder
2. Save Report on Report Server
3. Create a new project with Report Designer
4. Go to the Report Manager and Edit Report and save RDL file to Report
Designer project path
5. Add existing report to project created in step 3.
6. Apply features like Show/hide columns/Drilldown/Header/Footer/Company
Logo/Report properties/Change report parameters/ passing parameters to sub
report/Change column headers etc.
7. Save report (PUBLISH THIS REPORT TO REPORT SERVER WILL NOT WORK AND THROW
RUNTIME ERROR)
8. Go to Report Manager and upload and overwrite report file
9. Set report parameters in report manager (If required)
10. Run report with report server (if any initial parameter, apply in IE
address bar)
This is the way i am using RS 2005 (June CTP release). I am not sure whether
this is a right way of publishing report.
There are few advantages and disadvantages by using above way to develop
report
Advantages
- Utilising most of the report features available in Report designer
- Primary goal achieved by utilising Report model concept to develop report.
(BUT STILL EXPECTING MORE FEATURES AVAILABLE IN REPORT BUILDER)
Disadvantages
- Lot of maintainace to handle reports due to once upload this report can
not be edited in Report builder. Report builder capability is minimal and may
not be used as end user tool because final report is again developed in
report designer project which is a task of development team
- Adding a new column/change a layout etc. in existing report requires to
create report again i.e. STEP-1 as mentioned above
--
There is a light on the other side, Keep walking.
"Nilesh Trivedi" wrote:
> I would like to create a first dropdown list on my report. How can I do that?
> I am using followings,
> Reporting service (SQL Server 2005 June CTP release)
> Steps which I am following to create a report,
> 1. Creating a model using BIDS and publishing it to Report Server
> 2. By using Report Builder, I am creating new report and storing it on
> Report server. In one of my report, I would like to display dropdown list for
> Project with "Project Name". At present, I am using filter criteria for
> displaying parameter on each report but it is only displaying text field.
> I am still searching related post here and expecting help...
> Thnks
> --
> There is a light on the other side, Keep walking.

How to create a datasource which Connection type is SQL Server Anlysis Service in rss script?

I am making a rss script to deploy the reports and datasources.
I need to create a datasource which Connection type is SQL Server Anlysis Service. Thanks.

Does anyone know that? Or I am asking a stupid question?|||

I assume this has already been resolved but for anyone else;

Create a Datasouce in VS (or BIDS) of the Connection Type that you require and then open up the resulting .rds to

view the resulting connection type code.

i.e. For Analysis Services Connection Types

<Extension>OLEDB-MD</Extension> = Extension Code is "OLEDB-MD"

How to create a datasource which Connection type is SQL Server Anlysis Service in rss script?

I am making a rss script to deploy the reports and datasources.
I need to create a datasource which Connection type is SQL Server Anlysis Service. Thanks.

Does anyone know that? Or I am asking a stupid question?|||

I assume this has already been resolved but for anyone else;

Create a Datasouce in VS (or BIDS) of the Connection Type that you require and then open up the resulting .rds to

view the resulting connection type code.

i.e. For Analysis Services Connection Types

<Extension>OLEDB-MD</Extension> = Extension Code is "OLEDB-MD"