Can you open and use TWO databases in the same report?

Stimulsoft Reports.NET discussion
Post Reply
Mike Simpkins
Posts: 21
Joined: Tue Nov 30, 2010 1:06 pm
Location: South Dakota

Can you open and use TWO databases in the same report?

Post by Mike Simpkins »

I am using the .Net version of Stimulsoft in the POSitive Software environment. Is there a way to open a connection to a separate database using the XML code .n the MRT? For example, I have lots of data we use from our POSitive Retail Manager, but it would be nice to cross reference that with some of the data we get from our suppliers. The POSitive Connection opens up pretty much on its own. Are there additional commands in the XML (or is there addition C# code I can write on an event) that will allow me to access a second SQL database on the same SQL Server?


Mike Simpkins

Clueless in South Dakota
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Can you open and use TWO databases in the same report?

Post by Alex K. »

Hello,

Unfortunately, from the report in events, you cannot create connections to other databases, add new data sources, and display them in a report. You can do this either from the designer or from code of your application.

Thank you.
Mike Simpkins
Posts: 21
Joined: Tue Nov 30, 2010 1:06 pm
Location: South Dakota

Can you open and use TWO databases in the same report?

Post by Mike Simpkins »

I am using the report designer to make my reports. However, when I add a data source other than the POSitive Software Database, I simply get a data source with an "x" through it showing it as offline. Unless I am using the program incorrectly (which I may well be), I am very limited in how I can tell the report designer to connect to my 2nd DB.

I have included screen shots showing you what my Report Designer shows for the dictionary and what the screen looks like when I try to add a new data source. I am also including the XML from the Dictionary.DCT file where all I have is the POSitive Retail Manager connection and no additional data sources.

Code: Select all


  
  
  
  
  
If I add a data source, my DCT file looks like this:

Code: Select all


  
  
  
    
      DataSource1
      
        CUS_NAME,System.String
      
      30
      
      DataSource1
      POSitive Retail Manager
      
      select CUS_NAME from CUSMER
    
  
  
  
Finally, I tried to connect to a separate database (probably using the wrong syntax), in this case, I wanted to use my local SQL Server IT\SQLEXPRESS and the database "New DB". I was able to create the connection icon for it, but it came up with an "x" through it, making it unusable. Here is the DCT for that attempt:

Code: Select all


  
  
  
    
      DataSource1
      
      30
      
      DataSource1
      IT\SQLEXPRESS
      
      select * from ["New DB"].CUSMER
    
  
  
  

So, from within the Report Designer, is there a way for me to connect to a different database using these tools? What am I doing wrong? Is there a different way to specify the connection string? If so, how do I do it? I am posting a few screen shots to show you what I am running.

Attachments
724.Screen shot 2010-12-03 at 9.03.48 AM.png
724.Screen shot 2010-12-03 at 9.03.48 AM.png (53.25 KiB) Viewed 2369 times
723.Screen shot 2010-12-03 at 9.30.19 AM.png
723.Screen shot 2010-12-03 at 9.30.19 AM.png (40.96 KiB) Viewed 2370 times
722.Screen shot 2010-12-03 at 9.01.18 AM.png
722.Screen shot 2010-12-03 at 9.01.18 AM.png (38.62 KiB) Viewed 2370 times


Mike Simpkins

Clueless in South Dakota
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Can you open and use TWO databases in the same report?

Post by Jan »

Hello Mike,

Before creation new sql source you need add new sql connection to report dictionary for it. As I understand you can't add new connection from dictionary menu, but you can add it in report file. Please check xml from report with created sql connection:

Code: Select all

    
    
      
        MyConnection
        MyConnection String
        MyConnection
        False
      
    
    
    
    
    
  
Thank you.

Thank you.
Post Reply