Showing posts with label basic. Show all posts
Showing posts with label basic. Show all posts

Friday, March 30, 2012

running and exporting report using visual basic 6.0 (not using .net)

Hello,
I saw the post below that it is possible if we develop programs with C# or
VB.NET.
My question is
Is it possible to develop the program using visual basic 6.0?
If so, which reporting services dll should be referenced in visual basic 6.0
project?
Could you explain in detail what to do in visual studio IDE environment?
Thanks in advance,
StpnK
<<copied from the previous posts>>
>Yes, Reporting Services provide a set of Web Services API that you can call
>to generate report. Form your client app project (Win Form App), set web
>reference to the reporting services and look into its Render() methods. You
>can also learn more aboubt this from SQL Server2005 Book on Line.
>
"Smugliy" <Smugliy@.discussions.microsoft.com> wrote in message
news:184E2D63-E618-4C35-A0C5-5F3A647B3803@.microsoft.com...
> Hello ,All
> I am new to the reporting services and my question maybe stupid .
>
> I created some report and published it on the server.
> Now my question is : does it possible at all to run this report from my
> client (in C# )and to export the result to CSV format also from client
> Is there any web service that I can use which is calling for my report
> ?
> Please ,help me to understand this .
> Thanks a lot.
> Smugliy
>
>
>You would have to use the soap toolkit and do lots and lots of roll your own
coding. And even then there might be some incompatibilities.
Your best bet is to use URL integration. This is very straight forward and
easy to implement. Generate the URL string, embed the IE browser control (if
all you want to do is show the report) and set the url for the control.
There are lots of examples on the web of how to embed the browser control
and set the URL.
Books online has lots of examples of URL integration.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"stpnK" <ssdfatepano917@.optonline.net> wrote in message
news:47f3122d$0$15166$607ed4bc@.cv.net...
> Hello,
> I saw the post below that it is possible if we develop programs with C# or
> VB.NET.
> My question is
> Is it possible to develop the program using visual basic 6.0?
> If so, which reporting services dll should be referenced in visual basic
> 6.0 project?
> Could you explain in detail what to do in visual studio IDE environment?
> Thanks in advance,
> StpnK
> <<copied from the previous posts>>
>>Yes, Reporting Services provide a set of Web Services API that you can
>>call
>>to generate report. Form your client app project (Win Form App), set web
>>reference to the reporting services and look into its Render() methods.
>>You
>>can also learn more aboubt this from SQL Server2005 Book on Line.
> "Smugliy" <Smugliy@.discussions.microsoft.com> wrote in message
> news:184E2D63-E618-4C35-A0C5-5F3A647B3803@.microsoft.com...
>> Hello ,All
>> I am new to the reporting services and my question maybe stupid .
>> I created some report and published it on the server.
>> Now my question is : does it possible at all to run this report from my
>> client (in C# )and to export the result to CSV format also from client
>> Is there any web service that I can use which is calling for my report
>> ?
>> Please ,help me to understand this .
>> Thanks a lot.
>> Smugliy
>>
>
>|||Thanks for your reply. Bruce.
Let me explain details.
I have a VB6 program (A.EXE) keeping running on the server. This program
should do lots of things such as monitoring the incoming files, reading the
files and do various kinds of tasks depending on the file type and other
conditions on the file...
With certain type of files, this program needs to call report-generator
(dll) (this is the program I want to write) of SSRS 2005 (passing
parameters) so that the report-generator saves the output file as PDF format
on the network folder. After that this program picks up this PDF file and
send emails to the customer with PDF reports attachments.
So to speak, there is no user interaction, no report viewer required...
(1) Is it doable with vb6.0 projects (possibly connecting to SSRS without
user interaction)?
If so, can you tell me the sample URL site? or attach the sample?
(2) I think it is doable with C#.NET or VB.NET...
Can you introduce the URL of samples? Or attach the sample if you have any?
Best Regards,
stpnK
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:ul0WYuNlIHA.1184@.TK2MSFTNGP04.phx.gbl...
> You would have to use the soap toolkit and do lots and lots of roll your
> own coding. And even then there might be some incompatibilities.
> Your best bet is to use URL integration. This is very straight forward and
> easy to implement. Generate the URL string, embed the IE browser control
> (if all you want to do is show the report) and set the url for the
> control. There are lots of examples on the web of how to embed the browser
> control and set the URL.
> Books online has lots of examples of URL integration.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "stpnK" <ssdfatepano917@.optonline.net> wrote in message
> news:47f3122d$0$15166$607ed4bc@.cv.net...
>> Hello,
>> I saw the post below that it is possible if we develop programs with C#
>> or VB.NET.
>> My question is
>> Is it possible to develop the program using visual basic 6.0?
>> If so, which reporting services dll should be referenced in visual basic
>> 6.0 project?
>> Could you explain in detail what to do in visual studio IDE environment?
>> Thanks in advance,
>> StpnK
>> <<copied from the previous posts>>
>>Yes, Reporting Services provide a set of Web Services API that you can
>>call
>>to generate report. Form your client app project (Win Form App), set web
>>reference to the reporting services and look into its Render() methods.
>>You
>>can also learn more aboubt this from SQL Server2005 Book on Line.
>>
>> "Smugliy" <Smugliy@.discussions.microsoft.com> wrote in message
>> news:184E2D63-E618-4C35-A0C5-5F3A647B3803@.microsoft.com...
>> Hello ,All
>> I am new to the reporting services and my question maybe stupid .
>> I created some report and published it on the server.
>> Now my question is : does it possible at all to run this report from my
>> client (in C# )and to export the result to CSV format also from client
>> Is there any web service that I can use which is calling for my report
>> ?
>> Please ,help me to understand this .
>> Thanks a lot.
>> Smugliy
>>
>>
>>
>|||I use the URL method in two ways. One, I have used it for integrating in old
type of programs. For instance, we use In-Touch a real time MMI (in the real
time control world the environment that interacts with the user is called
MMI, man machine interface). For that I embed a browser control. However, in
your case you have no GUI and so you would need to go to a lower level,
getting some dll that will go to a website and then get the stream back and
do with it as you will. Personally I think this is going to be a mess.
I think a vb.net or c# program using web services would be a much better way
to go that using URL and VB6.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"stpnK" <ssdfatepano917@.optonline.net> wrote in message
news:47f6b3df$0$15199$607ed4bc@.cv.net...
> Thanks for your reply. Bruce.
> Let me explain details.
> I have a VB6 program (A.EXE) keeping running on the server. This program
> should do lots of things such as monitoring the incoming files, reading
> the
> files and do various kinds of tasks depending on the file type and other
> conditions on the file...
> With certain type of files, this program needs to call report-generator
> (dll) (this is the program I want to write) of SSRS 2005 (passing
> parameters) so that the report-generator saves the output file as PDF
> format
> on the network folder. After that this program picks up this PDF file and
> send emails to the customer with PDF reports attachments.
> So to speak, there is no user interaction, no report viewer required...
> (1) Is it doable with vb6.0 projects (possibly connecting to SSRS without
> user interaction)?
> If so, can you tell me the sample URL site? or attach the sample?
> (2) I think it is doable with C#.NET or VB.NET...
> Can you introduce the URL of samples? Or attach the sample if you have
> any?
> Best Regards,
> stpnK
>
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> news:ul0WYuNlIHA.1184@.TK2MSFTNGP04.phx.gbl...
>> You would have to use the soap toolkit and do lots and lots of roll your
>> own coding. And even then there might be some incompatibilities.
>> Your best bet is to use URL integration. This is very straight forward
>> and easy to implement. Generate the URL string, embed the IE browser
>> control (if all you want to do is show the report) and set the url for
>> the control. There are lots of examples on the web of how to embed the
>> browser control and set the URL.
>> Books online has lots of examples of URL integration.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "stpnK" <ssdfatepano917@.optonline.net> wrote in message
>> news:47f3122d$0$15166$607ed4bc@.cv.net...
>> Hello,
>> I saw the post below that it is possible if we develop programs with C#
>> or VB.NET.
>> My question is
>> Is it possible to develop the program using visual basic 6.0?
>> If so, which reporting services dll should be referenced in visual basic
>> 6.0 project?
>> Could you explain in detail what to do in visual studio IDE environment?
>> Thanks in advance,
>> StpnK
>> <<copied from the previous posts>>
>>Yes, Reporting Services provide a set of Web Services API that you can
>>call
>>to generate report. Form your client app project (Win Form App), set web
>>reference to the reporting services and look into its Render() methods.
>>You
>>can also learn more aboubt this from SQL Server2005 Book on Line.
>>
>> "Smugliy" <Smugliy@.discussions.microsoft.com> wrote in message
>> news:184E2D63-E618-4C35-A0C5-5F3A647B3803@.microsoft.com...
>> Hello ,All
>> I am new to the reporting services and my question maybe stupid .
>> I created some report and published it on the server.
>> Now my question is : does it possible at all to run this report from my
>> client (in C# )and to export the result to CSV format also from client
>> Is there any web service that I can use which is calling for my
>> report
>> ?
>> Please ,help me to understand this .
>> Thanks a lot.
>> Smugliy
>>
>>
>>
>>
>

Monday, March 26, 2012

Running a package in C#

Hello all. I am trying to run a package in C# and have come accross the help file of how to do it in Visual Basic ('Running an Existing Package using Visual Basic'). However, I cannot find a reference to anything relating to DTS in my reference dialog. In the help file it says to add a reference to Micorsoft.SQLServer.ManagedDTS.DLL, however, I cannot find this reference anywhere. Am I missing something?
Thanks,
MikeAre you using Visual Studio .NET 2005?
Visual Studio .NET 2002/2003 projects can't have references to
Microsoft.SQLServer.ManagedDTS.DLL, since it is built with .NET 2.0.
|||Sorry, yes I am running .NET 2005 June CTP.|||Have you GACd it? I'm not sure if you have to but its worth a try.

-Jamie|||Pardon my ignorance, but GAC? Not sure what you are referring to here?|||GAC stands for Global Assembly Cache. its basically where you put your assemblies that you want to use in a .net app (I think).

The default location is %windows-dir%/assembly/ I think.

-Jamie|||I haven't put any assemblies anywhere. From what I understand, the .dll that I cannot find is supposed to be one of the built in ones. It is not one that I have created. I guess it deals with running the SSIS packages. Kinda like DTSRun was for SQL 2000.
Now the one thing that I have noticed that I forgot to mention above is that my VS 2005 is running on my local box and my SQL Server Business Intelligence stuff and SQL Server 2005 is running on a different box. Not sure if this would make a differnce. I hope not, but thought I would check.|||You are correct that from a high level that DLL is used in running the packages. But your .net app doesn't know where to find that DLL so I'm guessing that you need to put it somewhere where it knows where to look for it - that place is the GAC.

Hopefully someone can confirm this. I'm not absolutely sure.

Check in your GAC to see if you can see Microsoft.SQLServer.DTSPipelineWrap

-Jamie|||Hi Jamie. Sorry to sound frustrated, just a bad morning. I guess I should clarify that I did a search on my computer and that .dll is nowhere on my machine. So I couldn't move it if I wanted to. I guess what I really need to know is at which point does that .dll get loaded? When installing SQL Server 2005 or when installing VS 2005? Like I stated earlier, my VS2005 install and my SQL Server 2005 intsall are on two seperate computers. If it is installed when SQL Server 2005 is installed, is there a way to install just the Business Intelligence without installing SQL Server?
On my computer I have absolutely NO references to ANYTHING having to do with DTS. I have even done a search for anything containing DTS in the name and nothing was found.
Sorry for being confusing. Like I said, it has been a rough morning!
Thanks for your kind help!
Tazz|||The DLL gets loaded when you install Integration Services (as far as I know).

-Jamie|||The assembly that's being discussed, Microsoft.SqlServer.ManagedDts.dll, contains the Microsoft.SqlServer.Dts.Runtime namespace and thus the Application and Package objects. It is installed by default to C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies.

I believe that this file is installed if you install Business Intelligence Development Studio only, as BIDS installs everything necessary to design and test SSIS packages, but I can't easily verify this with my own eyes at the moment.

Now that SSIS exists as a robust ETL platform, it is no longer "redistributable" in the way that DTS was, simply by copying a few DLLs to client machines.

-Doug
|||The Add Reference dialog in VS does not use the GAC, but certain other folders, known "assembly" folders that VS knows to check. There is a KB which I assume is valid for VS2005, which describes is a registry key with the folders listed. So the assembly needs to be in a VS known location, not the GAC at this stage. (Jamie remember the fun with adding a reference to a Script Task).

The DLL may be installed in the GAC as well to help it be located at run-time, and save having multiple installs etc, but that is not the issue for Add References. Obviously as has now been determined, you need to install BIDS to get the DTS/SSIS assemblies, when they will be installed suitable folders, and actually in the GAC as well.|||

Tazzmann wrote:

...is there a way to install just the Business Intelligence without installing SQL Server?
...

Yes and I have it that way.
While installing you have to select only the option to install BIDS (I forgot the exact name of the option to select, but it is something like "development tools, documentation...")

HTH,
Nitesh

Running a job from a Report using a button? (Is that possible)

Here is the deal. We have a mapping table that stores basic info (like
4 columns). These columns are used to populate parameter boxes in a
report (some parameters depend on the values of others and so we had
to use a mapping table for performance increase). The mapping table
is loaded hourly using a job that calls an SSIS package. Simple
stuff. However, let's assume the user logs in at 12:30 and there is
new data that is not showing, they cannot wait 30 minutes until the
job runs again. At the same time, we can't make the job run that
frequently. So we want to set up a "button" that the users can click
on and it will allow the job to run. We cannot have the job run every
time the report is loaded, takes too much time and would defeat the
purpose of performance enhancement.
So far I have this script in a dataset that points to the msdb
database on our reporting box:
exec dbo.sp_start_job @.job_id=N'd6ca06e2-73c4-4fe0-8924-b24bdc8cc78e''
I put it as a text command and it works fine, BUT ASKS ME FOR THE JOB
ID!!! I've pressed the ... button near the dataset to try to hard
code the parameter there, no luck.
Also, what would I use to add the user functionality, namely them
being able to click on something to invoke the job?
Thank you so much.I would like add buton to rerun an SSIS package. How did you add a button in
RS?
"Ayman" wrote:
> Here is the deal. We have a mapping table that stores basic info (like
> 4 columns). These columns are used to populate parameter boxes in a
> report (some parameters depend on the values of others and so we had
> to use a mapping table for performance increase). The mapping table
> is loaded hourly using a job that calls an SSIS package. Simple
> stuff. However, let's assume the user logs in at 12:30 and there is
> new data that is not showing, they cannot wait 30 minutes until the
> job runs again. At the same time, we can't make the job run that
> frequently. So we want to set up a "button" that the users can click
> on and it will allow the job to run. We cannot have the job run every
> time the report is loaded, takes too much time and would defeat the
> purpose of performance enhancement.
> So far I have this script in a dataset that points to the msdb
> database on our reporting box:
> exec dbo.sp_start_job @.job_id=N'd6ca06e2-73c4-4fe0-8924-b24bdc8cc78e''
> I put it as a text command and it works fine, BUT ASKS ME FOR THE JOB
> ID!!! I've pressed the ... button near the dataset to try to hard
> code the parameter there, no luck.
> Also, what would I use to add the user functionality, namely them
> being able to click on something to invoke the job?
> Thank you so much.
>|||Hi,
I think the problem is the "@.". Try to use a sproc instead of a text
command.
"Ayman" <aymantg@.gmail.com> schrieb im Newsbeitrag
news:1184855299.083046.294670@.z24g2000prh.googlegroups.com...
> Here is the deal. We have a mapping table that stores basic info (like
> 4 columns). These columns are used to populate parameter boxes in a
> report (some parameters depend on the values of others and so we had
> to use a mapping table for performance increase). The mapping table
> is loaded hourly using a job that calls an SSIS package. Simple
> stuff. However, let's assume the user logs in at 12:30 and there is
> new data that is not showing, they cannot wait 30 minutes until the
> job runs again. At the same time, we can't make the job run that
> frequently. So we want to set up a "button" that the users can click
> on and it will allow the job to run. We cannot have the job run every
> time the report is loaded, takes too much time and would defeat the
> purpose of performance enhancement.
> So far I have this script in a dataset that points to the msdb
> database on our reporting box:
> exec dbo.sp_start_job @.job_id=N'd6ca06e2-73c4-4fe0-8924-b24bdc8cc78e''
> I put it as a text command and it works fine, BUT ASKS ME FOR THE JOB
> ID!!! I've pressed the ... button near the dataset to try to hard
> code the parameter there, no luck.
> Also, what would I use to add the user functionality, namely them
> being able to click on something to invoke the job?
> Thank you so much.
>

Wednesday, March 21, 2012

run time error

I create an application with Visual Basic 6 and Crystal Report 10
with IDE Environment.While Developing the application it works fine
in my system.but after i made the application
setup, and when while I am deploying (install)the application
in the same system (widows xp) it show run time error. i ignore the
error and continue the installiation till the end.
and then when i run the application it works ok but when i use print
command it show error(crviewer file not found). and the application
closed.so what is the problem here.please help
to solve it.

thanksEither you have not included the crviewer.dll file in your setup package or there might have been a problem while copying/registering the file. Try registering the File manually using regsvr32.

Friday, March 9, 2012

Run DTS Package from Visual Basic 6.3

Anyone have any code i can use to call a DTS package from Visual Basic. I would like to have an outlook macro that will run a dts package when i receive an email. All i need is the code that will call a dts package for a sql server that is not local to the box. I've tried this code but i get an error
run_tmie error '-2147217900 (80040e14)' automation error

Public Sub main()

Dim oPkg As DTS.Package2
Set oPkg = New DTS.Package2

oPkg.LoadFromSQLServer MyServerName, MyUserName, MyPassword, , MyDTSPackageName

oPkg.Execute
oPkg.UnInitialize

Set oPkg = Nothing

End Sub


Thanks in advance.I use the following in a VBScript. Will work in VB also.

strDTSRun_Command = "dtsrun.exe /Sservername /E /Ndtspackagename"
iWindowStyle = 10
bWaitOnReturn = true
Return = WshShell.Run(strDTSRun_Command, iWindowStyle, bWaitOnReturn)

run database slower

I have database, Visual basic as front end, and sql server as backend, the reports are using crystal report. Recently, the user complain it is too slow to run, it took a long to load the data, anybody help me? Thanks in advance.How can i check what cause this problem. I check the active log file, it didn't help.|||You have to look a couple of things:
1. Design of the database
2. Indexes
3. Execution plan of your queries.

Without this info, it is very hard to provide any help.|||It is sometime very slow. I will check these you posted as this system was design by somebody else. I had question, can this sql server perfome slower in some case that is not relation to design that you said? I want to make sure it is not sql server problem. So i will only check the design. Thanks.