Changes on "New Data Source" screen

Stimulsoft Reports.NET discussion
Post Reply
marco.correa
Posts: 26
Joined: Wed Nov 16, 2011 12:33 pm
Location: Blumenau, Santa Catarina, Brazil

Changes on "New Data Source" screen

Post by marco.correa »

Hello,

1- We need to hide the Edit button on "New Data Source" window.

2- We also need to hide the adapters below of connections list.

How can we do that?

Thank you.
Attachments
1785.new_data_source.png
1785.new_data_source.png (37.36 KiB) Viewed 2821 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Changes on "New Data Source" screen

Post by HighAley »

Hello.
[quote="marco".correa]1- We need to hide the Edit button on "New Data Source" window.[/quote]
We'll try to add this feature. We'll let you know when it will be available.

[quote="marco".correa]2- We also need to hide the adapters below of connections list.[/quote]
You could disable service only. Try to use next code:

Code: Select all

foreach (StiService service in StiConfig.Services)
{
    if (service is StiOleDbAdapterService || service is StiSqlAdapterService) service.ServiceEnabled = false;
}
Thank you.
marco.correa
Posts: 26
Joined: Wed Nov 16, 2011 12:33 pm
Location: Blumenau, Santa Catarina, Brazil

Changes on "New Data Source" screen

Post by marco.correa »

Hello.

1- Ok.

2- We want to hide all the connectors. We implemented the code to do that but we resulted a error.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Changes on "New Data Source" screen

Post by HighAley »

Hello.
[quote="marco".correa]We want to hide all the connectors. We implemented the code to do that but we resulted a error.[/quote]
Please, send us that code. What error do you have?

As an alternative you could disable New Connection menu with next code:

Code: Select all

Stimulsoft.Report.Design.Panels.StiDictionaryPanelService service = Stimulsoft.Report.Design.Panels.StiDictionaryPanelService.GetService();
service.ShowConnectionNewMenuItem = false;
Thank you.
marco.correa
Posts: 26
Joined: Wed Nov 16, 2011 12:33 pm
Location: Blumenau, Santa Catarina, Brazil

Changes on "New Data Source" screen

Post by marco.correa »

Hello,

Follow the sample project.

Thank you.
Attachments
1862.ReportAdapters.zip
(58.47 KiB) Downloaded 404 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Changes on "New Data Source" screen

Post by HighAley »

Hello.

You should use code with deleting services and menu items before InitializeComponent() method.

Than you.
marco.correa
Posts: 26
Joined: Wed Nov 16, 2011 12:33 pm
Location: Blumenau, Santa Catarina, Brazil

Changes on "New Data Source" screen

Post by marco.correa »

Hello.

If we hide all conectors and add a new datasource will be shown the "New Data Source" window instead of "Select Data".

We want to hide adapters to don't confuse the our users that uses the tool.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Changes on "New Data Source" screen

Post by HighAley »

Hello.

Please, try to use next code to disable SQL and OleDB adapters:

Code: Select all

StiServiceContainer services = StiConfig.Services.GetServices(typeof(StiDataAdapterService));
foreach (StiDataAdapterService service in services)
{
    Type serviceType = service.GetType();
    service.ServiceEnabled = !serviceType.Equals(typeof(StiSqlAdapterService)) && !serviceType.Equals(typeof(StiOleDbAdapterService));
}
Thank you.
Post Reply