Dictionary databind

Stimulsoft Reports.WEB discussion
microdata
Posts: 3
Joined: Fri May 07, 2010 6:56 am
Location: Brazil

Dictionary databind

Post by microdata »

Hi,

I'm trying to make data available for creating a report coming from InterBase, but whenever an x appears over the datasource as the image attached.

Here below the code in c #:

protected void Button1_Click(object sender, EventArgs e)
{
StiReport report = new StiReport();

report.RegData("Procedimentos", ObterProcedimentoCad());
report.Dictionary.Connect(true);
StiWebDesigner1.Design(report);
}

private DataTable ObterProcedimentoCad()
{
StringBuilder sql = new StringBuilder();
//sql.Append("SELECT prc_id, nome FROM PROCEDIMENTOS");
sql.Append("SELECT * FROM ACESSOS");

Database data = new Database(connString);
DataTable dt = new DataTable();
dt = data.Select(sql.ToString());
return dt;
}

Image:

Thus the data do not appear in the report, although the display table fields. How to fix this?

Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Dictionary databind

Post by Vladimir »

Hello,

You must also add database to dictionary. Please use the following code:

Code: Select all

StiSqlDatabase database = new StiSqlDatabase("Procedimentos", connString);
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(database);
Thank you.
microdata
Posts: 3
Joined: Fri May 07, 2010 6:56 am
Location: Brazil

Dictionary databind

Post by microdata »

Vladimir wrote:Hello,

You must also add database to dictionary. Please use the following code:

Code: Select all

StiSqlDatabase database = new StiSqlDatabase("Procedimentos", connString);
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(database);
Thank you.
Hi Vladimir,

My database is Interbase. The datasource does not appear more like an x on top, but to put it in a DataBand data are not presented.
I changed the code to StiOledbDatabase since StiSqlDatabase not work, follow the code below

Code: Select all

        string connString = "Provider=LCPI.IBProvider.3.Free;Assembly=Borland.Data.Interbase,Version=2.0.0.0, Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b;Database=10.0.10.21:C:\\Microdata\\Dce\\data\\dbdce.ib;UserName=SYSDBA;Password=masterkey";
        
        protected void Page_Load(object sender, EventArgs e)
        {
            StiReport report = new StiReport();
            //report.Load("C:\\Report1.mrt"); 

            report.LoadFromString(ObterRelatorioString("SELECT TEXTO FROM TEXTOS WHERE NOME = 'rodrigo'"));
            StiWebViewer1.Report = report;
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            StiReport report = new StiReport();
            
            report.RegData("Procedimentos", ObterProcedimentoCad());
            StiOleDbDatabase database = new StiOleDbDatabase("Procedimentos", connString);
            report.Dictionary.Databases.Clear();
            report.Dictionary.Databases.Add(database);
            StiWebDesigner1.Design(report);
        }

        private DataTable ObterProcedimentoCad()
        {
            StringBuilder sql = new StringBuilder();
            sql.Append("SELECT PRC_ID, NOME FROM PROCEDIMENTOS");
            //sql.Append("SELECT * FROM ACESSOS");

            Database data = new Database(connString);
            DataTable dt = new DataTable();
            dt = data.Select(sql.ToString());
            return dt;
        }
Image
Image
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Dictionary databind

Post by Vladimir »

Hello,

You must download and install the Firebird Database pack, which located on the download page of our website. Here's the direct link: http://www.stimulsoft.com/Downloads/Fir ... tabase.zip
Installation instructions are included in the archive.

Thanks.
microdata
Posts: 3
Joined: Fri May 07, 2010 6:56 am
Location: Brazil

Dictionary databind

Post by microdata »

Ok I did as mentioned in installation.txt but continued to have the same screens above, with no results.

Image
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Dictionary databind

Post by Vladimir »

Hello,

In addtion, please try to use the GetPreviewDataSet event for adding database services:

Code: Select all

protected void StiWebDesigner1_GetPreviewDataSet(object sender, StiWebDesigner.StiPreviewDataSetEventArgs e)
{
    StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiFirebirdAdapterService());
    StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiFirebirdDatabase());
}
If this will not work, please use this code in the PreInit event.

Thank you.
hadisaadat_du
Posts: 35
Joined: Tue Nov 09, 2010 2:43 pm
Location: iran

Dictionary databind

Post by hadisaadat_du »

Hi every body.
I sea allmost all topic in forum and seem int all of them posit that we know what is our tables and columns in dataset of our reportbut allways not thus
1-sometime we may want to edit the report in webdesigner that we dont know any thing about its data set but we sure it works with our data base , so befor call the design() function we pass what data set to our report via regdata(//what_dataset) ??
2- or we may want to set full access to data base to one user to create the every report that need to design well we pass a full data base to designer dictionary and he/she design every report by every columns in every tables or viwes in database and save it , in viwe report mode namely after load our report and we want to pass it to stiwebviewer we pass what data set to it since we cant pass all data base to our report ??!
paulo.mariano
Posts: 1
Joined: Thu Aug 04, 2011 7:56 am
Location: SP, Brazil

Dictionary databind

Post by paulo.mariano »

i had the same problem, thanks for the post was usefull.

needed was adding the config
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Dictionary databind

Post by Andrew »

Ok!
samueldearaujo
Posts: 10
Joined: Tue Oct 15, 2013 7:49 pm
Location: Itaúna, Minas Gerais, Brasil

Re: Dictionary databind

Post by samueldearaujo »

Hi!
I'm trying to register an external adapter like this post, but isn't working.
I want to connect a report with a Firebird database, so i created the dll file how described in installation file.
In the main project, i made a reference to this library (Stimulsoft.Report.FirebirdDatabase.dll). But, same referencing the library, the VS(2010) mark an error.

'Error 3 The type or namespace name 'StiFirebirdAdapterService' does not exist in the namespace 'Stimulsoft.Report.Dictionary' (are you missing an assembly reference?)'
stfb1.PNG
stfb1.PNG (79.56 KiB) Viewed 5008 times
If i remove the references of the library (Stimulsoft.Report.dll), the error changes.
The namespace 'StiConfig' is not found and the method 'StiFirebirdAdapterService()' is found.
stfb2.PNG
stfb2.PNG (79.11 KiB) Viewed 5008 times
What do i making wrong?

When I was compiling the Firebird adapter project , had some problems with the versions of the .NET Framework. Then i compiled it with version 3.5. My project is using the version 4 and I've already changed it but nothing.
The version of FirebirdClient.dll that i used for compiling the project, is 2.5.1.0.
And I use the version 2013.3 of Stimulsoft.

That's it, thank you!
Post Reply