Query timeout in embedded RDLC vb 2008 - vb.net

How does one increase the query timeout when using local reportviewer from the default of 30 seconds.
I am not using code to create the dataset. I went through wizard choosing connection and setting the report to use a stored procedure to fill adapter.
I don't have access to change ds.querytimeout setting.
This is a not using SSRS. the report is local and embedded.
call the report as such
ReportForm2.SpRetrieveReportIncentiveSummaryTableAdapter.Fill(ReportForm2.Prdatalyons728DataSet.spRetrieveReportIncentiveSummary, tStart.Text, tEnd.Text, areas, pickers, " ", "hh:mm:ss", 0, " ")
ReportForm2.ReportViewer1.RefreshReport()

I was able to add it like this
ReportForm.SpRetrieveReportIncentiveSummaryTableAdapter1.SetCommandTimeOut=
Set the timeout on the table adapter

Related

Connection template, resetting connections and looping thru

Back Story
I am working with SAGE Mas 200 software, trying to link to it through Access. This software houses date for 300 investors for my company. With EACH investor I have a different investor ID that goes along with my UID and Password upon logging in, therefore EVERY connection string is different.
After many hours of trial and error, I have been successful in connecting via Access to only find out that I can only have one active connection string per database. Since I have 300 investors that I need to pull data from, there is the problem...and I can't figure it out.
I am a newby with VBA so my knowledge is extremely limited. I have read about linking to a 'template' file with the connection strings, but not sure how to format the template file. Can someone show me an example? Also, how would I get it to loop thru each query stored in the database and then pull the appropriate connection string?
Examples
Here is an example of my connection string where 'AAL' is the investor code:
ODBC;DSN=SOTAMAS90;UID=tbard|AAL;PWD=password;Directory=\\mas-200\MAS90;Prefix=\\mas-200\MAS90\SY\, \\mas-200\MAS90\==\;ViewDLL=\\mas-200\MAS90\HOME;SERVER=NotTheServer
The query name for this would be MAS_AAL.
Another investor: SMP, the query name MAS_SMP. Etc, etc, etc...
Can someone be my light at the end of the tunnel and help me out so I don't have to manually run 300 queries. I'm dying over here!!
You can programmatically set the connection string.
There is a MAS 90 / MAS 200 ODBC driver called SOTAMAS90. On MAS installations in the last 5 years, there is both a 32 and a 64 bit driver.
In VBA, if I remember correctly, you would do something like this. (This assumes you already have fetched the Investor object you need, and it has properties called username and password):
Dim conn as new ADODB.Connection()
' Set properties of connection string manually
conn.ConnectionString = "DRIVER = SOTAMAS90; UID=" & myInvestor.username & "; PWD=" & myInvestor.password & "; Company=ABC"
conn.Open()
Another approach is to use a single ODBC connection within Access, to set up a linked ODBC table, using Access' Get External Data feature. Then you can treat it like any other Access table, and just query it directly. The problem with this approach is that Access will keep prompting you for credentials, both when you first open the table, and then if you are inactive for a while. I'm told you can save the UID and password in the SOTAMAS90 ODBC connection, but I've never done it.
Hope that helps.
Aaron

SSRS Scheduled Subscription hyperlinks not working

I am Currently using Reporting Services 2014. I am using the following code to be able to use a javascript pop-up window on the sharepoint site itself. The code also addresses the export to Excel link through an iif statement that
evaluates whether the RenderFormat is being viewed on the site or if it is another format (Excel, Word, PDF etc). The iif statement uses a variable that replaces the ReportServerURL with the appropriate site. Everything works fine in when using the links on the site and when exporting to Excel from the site.
The problem occurs when I set up a scheduled subscription which sends an Excel file of the report. The ReportSerURL is different form the above situations. We have two sites that use http://gsp1/ReportServer and http://gsp2/ReportServer in the scheduled subscription excel file.
This is the code that I am currently using for using hyperlinks on the site and Export to Excel from the site. Is there a way that I can also incorporate some logic to address the scheduled subscription files?
SSRS URL Action (Uses Variable below)
=iif(
(Globals!RenderFormat.Name = "RPL"),
"javascript:void(window.open('"+ Variables!RxDrill.Value + "&rv:ParamMode=Hidden&rv:Toolbar=None&rv:HeaderArea=None&rp:StoreKey=" + Fields!StoreKey.Value.ToString + " &rp:RxNumber=" + Fields!RX.Value.ToString + "&rp:RefillNumber=" + Fields!RefillNumber.Value.ToString + "', 'RXOVERVIEW','width=1335,height=450,location=no'))",
Variables!RxDrill.Value + "&rp%3aStoreKey=" & Fields!StoreKey.Value & "&rp%3aRxNumber=" & Fields!RX.Value & "&rp%3aRefillNumber=" & Fields!RefillNumber.Value & "&rs%3aParameterLanguage=")
Variable
=Replace(Globals!ReportServerUrl,"/_vti_bin","/_layouts/15") + "/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRS%20Library/Rx Transaction Detail.rdl"
This is the error I currently get when trying to open a link in a subscription excel email file.
I dropped a [&ReportServerUrl] textbox and found that the path is not the same in the scheduled subscription as it is in the browser or during export to excel. I have found that there are 2 possible ReportServerURLs that the subscription uses. http://gsp1/ReportServer or http://gsp2/ReportServer. In the Browser it is always https://abc.myinfocenter.net/_vti_bin/ReportServer, but as you can see from the variable code above the _vti_bin is replaced.
It appears that the problem lies in the fact that when you load the report via sharepoint, you are retrieving the sharepoint server information using the Globals!ReportServerUrl value. However, with the subscription on a different SSRS server, you're retrieving a different server value: the server generating the subscription. SharePoint knows what server it's on and can tell SSRS that when you access the report via the SharePoint site. However, when you're generating the report on the SSRS server directly, the SSRS server has no idea the SharePoint site even exists.
To solve this, then, you will need to tell the SSRS server the URL for the SharePoint site. You could hard-code the SharePoint URL into an expression for the variable or elsewhere, but then that's a little harder to maintain. I would recommend solving this problem in the following way that makes maintenance a bit easier and more transparent:
Create a new parameter in your report called SharePointURL. Set the default value to https://abc.myinfocenter.net/_vti_bin/ReportServer or whatever it is when the report generates correctly in the browser. The reason you're doing this as a parameter is so that it's easier to maintain should your SharePoint site change. Set this parameter to be hidden or internal.
Change the expression for your variable to incorporate the SharePointURL parameter.
New Variable Expression:
=Replace(IIF(Globals!RenderFormat.Name = "RPL",Globals!ReportServerUrl,Parameters!SharePointURL.Value),"/_vti_bin","/_layouts/15") + "/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRS%20Library/Rx Transaction Detail.rdl"
Hopefully that will fix your issue.

Vb.NET rasdial parameters

I am making a program that schedules the redial of a VPN connection using rasdial however I cannot get my script to pass the correct information to the rasdial.exe program.
For example
Process.Start("rasdial.exe", "VPN Connection " & ""USERNAME!" & "PASSWORD")
However when this starts it just says "Remote access error 625"
It turns out that the best solution is to concatenate the variables before storing them in a database or document because the connection only inputs one parameter.

Unable to add tables to Crystal Reports

Background:
I have an old report in which I am trying to add a table and a field. The report works perfectly fine in my web application. (Crystal reports ver. 11.5.9.1076)
After adding a table I get the error:
System.Runtime.InteropServices.COMException: Failed to open connection
This happens whether I add a table, command, or stored procedure to the report. (Connecting to Oracle database)
Things I've tried:
Add table (crashes), remove table (works again)
Click the "Verify database" button in the Database menu
Set database location and update the newly added table
Previewing the report seems to work
As for how I'm providing the data:
Create and load ReportDocument (VB.net)
Populate DataSet
Call SetDataSource method with DataSet as param
ExportToHttpResponse as PortableDocFormat
Here is what we had to do in order to make this work in our crystal reports: after loading the report, we loop through each of the DataSourceConnections in the report and update the connection information.
For Each oConnection As IConnectionInfo In oReport.DataSourceConnections
If fUseIntegratedSecurity Then
oConnection.SetConnection(sServerName, sDatabaseName, True)
Else
oConnection.IntegratedSecurity = False
oConnection.SetConnection(sServerName, sDatabaseName, sUserLogon, sUserPassword)
End If
Next
The actual connection details are provided elsewhere in our app, so I am just showing placeholders in the code above.

Vb.Net preview report from access database

I am using visual studio 2010 to develop my desktop application and ms access database. I have already designed reports in access database and they are working perfectly. Now my concern is that is it possible to use these access reports in my Vb.Net application?
I need this because it would be much easier to distribute the software instead of using crystal report where I will need to install a run time machine for crystal reports.
It's possible to do but it's a horrible implementation. You basically have to launch Access, open the database file in Access, then navigate down and launch the report. There is no way to just "view" the report inside your app. It will only show inside Access.
I think your best option is to use ReportViewer control if you don't want to use Crystal Reports.
I found this: https://support.microsoft.com/kb/317113?wa=wsignin1.0
To preview or to print an Access report, you call the OpenReport method of the DoCmd object. When you call OpenReport, one of the arguments that you pass determines whether the report is previewed on the screen, or whether it is sent to the printer:
' Preview a report named Sales:
oAccess.DoCmd.OpenReport(ReportName:="Sales", View:=Access.AcView.acViewPreview)
' Print a report named Sales:
oAccess.DoCmd.OpenReport(ReportName:="Sales", View:=Access.AcView.acViewNormal)
But I haven't been able to find much info/help regarding OpenReport method or DoCmd object.
I am not a proffesional developer, but after long research it's worked for my project.
I would like to open directly from MS Access, my existing reports and then to open these from not default installation folder path (different for each one pc). The third requirement was to open more than one report (Not all together).
Design:
Form8.vb [Design]
vb.Net Code:
Imports System.ComponentModel
Imports Microsoft.Office.Interop.Access
Public Class Form8
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oAccess As New Microsoft.Office.Interop.Access.Application()
Dim CurDir As String = System.AppDomain.CurrentDomain.BaseDirectory
Dim FPath As String = CurDir & "\YourDatabase.accdb"
oAccess.Visible = True
oAccess.OpenCurrentDatabase(FPath)
If ComboBox1.Text = "Your text" Then
oAccess.DoCmd.OpenReport(ReportName:="Your Report Name", View:=AcView.acViewPreview)
ElseIf ComboBox1.Text = "Your text2" Then
oAccess.DoCmd.OpenReport(ReportName:="Your Report Name", View:=AcView.acViewPreview)
ElseIf ComboBox1.Text = "Your text3" Then
oAccess.DoCmd.OpenReport(ReportName:="Your Report Name", View:=AcView.acViewPreview)
End If
End Sub
End Class
Replace YourDatabase with YourDatabaseName, Replace Your text,Your text1,Your text2,Your text3 with YourText, Replace Your Report Name with the Name of your report Name, As needed.
Finally, in order for this solution to work, you need:
1) Your (Conn.open) connection to look like this:
Dim dbsource As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source = |DataDirectory|\Your DB.accdb"
2) In Solution Explorer, Your database to include in your project or to your setup project, to be installed with your project. like this:
Solution Explorer [image]
SetUp Project link
3) At server explorer, Data Connection the (Sourse) Database file name, must be with the full path name e.g like this:
C:\Users\User\Desktop\YourDatabase.accdb, and the connection String at the Properties like this:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source = "C:\Users\User\Desktop\YourDatabase.accdb".
I hope this helps!!!
The following code:
Preview a report named Sales:
oAccess.DoCmd.OpenReport(ReportName:="Sales", View:=Access.AcView.acViewPreview)
Print a report named Sales:
oAccess.DoCmd.OpenReport(ReportName:="Sales", View:=Access.AcView.acViewNormal)
But I haven't been able to find much info/help regarding OpenReport method or DoCmd object.
This will only work if you are using VB.Net to automate the Access application. This will open the Access application and allow you to view or print the reports just as if you were running Access directly. However, you need to have the Access application (not just the .mdb or .accdb file) on the computer that is running the VB.Net application.
I have not found any way to utilize the Access reports without having Access on the computers running the VB.Net application. I'm looking into using Crystal Reports for the application I'm working on now.