BC: How to add a dataset and modify a report from 'base microsoft' with a 100xx ID? - rdlc

I am trying to modify a report that is given by base microsoft and I can't figure out how to 'replace' and add a dataset the 10081 report.
I have tried copying the report and modifying it, but I need to add a dataset and don't have access to the al code due to it being a base microsoft report.
I tried to make a new report, it just wont appear when I try and got o the returns. When I try to replace the 10081 report with the custom 5014x report it gives me an odd error like 'textbox billtity needs to be named billtocity' even though it is. I have also included the '=First(... , 'dataset') in the expresssion
Any youtube links, links to documentation or anything would be helpful.

Related

MS Access: Query to list number of files in a series of folders

I have folders labeled by their keyfield, so 1, 2, ... 999, 1000. located in currentproject.path\RecordFiles\KeyFieldHere so like currentproject.path\RecordFiles\917.
I want to run a query that will count how many files are in each folder. I know this can be done with the DIR function through visual basic, but I can't seem to run it through a SQL query.
I've tried using this function in a SQL equation, so Expr1: [FlrFileCount("Y:\Education\Databases\RecordFiles\")] as one of the fields just to see if it can work, but it prompts me for a value and then returns nothing.
EDIT: I tried an approach using the FlrFileCount function in a continuous form, and it does work, BUT... I get an error after every single line. I have a field in a continuous form of =FlrFileCount([currentproject].[path] & "\recordfiles\" & [ID]), but when I run the form I get an error "Error 76, Error source: FlrFileCount, Error description: Path not found." Which is crazy because IT WORKS, it properly lists the number of files in the folder for each record.
I just need to get this functionality over into a SQL query so I can pull that data for mail merges.
I currently have something similar in a form. The form has an onload property to run a module (Link here) to create a list of all the files in the relevant folder to that record, and then I have another field that just counts the number of entries in the list. However a list can't be a value in a SQL query, so I don't think that code will help.
Thanks to Tim Williams, the answer was to put
=FlrFileCount(Currentproject.Path & "\recordfiles\" & [ID])
It seems the [currentproject].[path] part was where the error was. What's confusing is that in other places, MS Access adds the extra [] around currentproject and path, and I don't know why.
Thank you so much for your help! Now to the tricky part: Implementing a proper naming scheme by program ID across a sharepoint so that the relevant folder can be opened consistently even when program names change.

Load only select sections of Code in QlikView

I have a set of code that is rather large in Qlik. I have dates that are defined at the start of the script
i.e.
Let vBDate = Date(Date#('01/01/2015','MM/DD/YYYY'),'MM/DD/YYYY');
Let vEDate = Date(Date#('12/31/2015','MM/DD/YYYY'),'MM/DD/YYYY');
The entire code runs financial numbers based on a specific data source. Originally I had a version of this QVW for each data source. However, as often goes with financials the QVW constantly needs to be refined. So I merged them all into one code. I broke the Code up into different tabs so I can turn off the sources I don't want.
What I want to do is try to se a variable, either in the code, like this,
Let vROIType = 'Vendor';
or using the method answered in my first attempt at this question where the variable is defined on the designer side using a button.
The hope is that when the variable is set, then only the code associated with that variable will run in the reload and the other code will be skipped.
In my research I tried to create functions in the script and use code to call them, however the call would always error out. I also read about QVDs but many of my date variables are defined at the start of running it, and the QVD needs to be pre-run.
Any help would be appreciated.
As long as you wrap the appropriate sections of the script in the conditionals properly, this should accomplish it:
Create a variable via the Variable Overview window (ctrl + alt + v) like you mentioned to reference the correct script to be reloaded (vROIType)
Create a button or text box and set an action to change the value of the vROIType variable. You can just make two buttons so you can select the correct data source by clicking the appropriate button.
Either reload via the menu or create another text box/button with an action to reload your script.
Most importantly, use conditionals in your script to selectively run the correct portions based on the vROIType variable.
if vROIType = 'Vendor' then
Everything in the script you want run when the source is `Vendor`.
elseif vROIType = 'SomeOtherVendor' then
Everything in the script you want run when the source is ....
end if;
Upon reload, the script will look at the vROIType variable and use that to determine whether or not to run parts of the script. Here's a link to a simple example you can try if you have the paid version of Qlikview, otherwise it'll yell at you that you can't open third party .qvw's.

Add a row using linq or sql in VB.NET

I am developing an application, and as one of the steps, I need to have a set of information backed up to an SQL database.
I don't have any experience using SQL, and was hoping I could find a simple command that would just add a row with the information i'd needed... But I don't understand much of the information I've found for it. I've even had issues just using the snippet provided within Visual Studio.
I tried using the snippet for adding a row, and here's the code that's produced.
The reference to RDataSet.ArchivedIncidentsDataTable keeps giving me an error message telling me "object reference to non-shared object requires an object reference", which to me, is one of the least helpful error messages you could possibly receive. I don't understand what it means, or what I need to do in order to fix it.
Here is the code that I have, which is basically just the snippet that's provided:
Private Sub Save_SQLBackup_Info()
Dim newRow = CType(RDataSet.ArchivedIncidentsDataTable.NewRow(), RDataSet.ArchivedIncidentsRow)
newRow.CustomerID = "A124"
newRow.CompanyName = "Acme"
RDataSet.ArchivedIncidentsDataTable.Rows.Add(newRow)
End Sub
I'm not sure how filling in the fields for this small amount of code produced an error.
Also, after this segment of code is run, don't I have to run a command to update the database? The guides I'd been following online all referenced something like that, but I didn't understand the other parts of them.
I'm sure the problem i'm having is a matter of "You didn't declare X.", however I don't know much about SQL... If that's even what I'm using.
I would appreciate some guidance.
All I need to do is add a row to the database using a few fields from the form.
I have an online SQL server linked as a data object, and the dataset is titled RDataSet , the data table is titled ArchivedIncidentsDataTable.
The few guides I've found online reference different parts, like data adapters, that I don't have, and / or don't reference how they got to that part... I'm completely lost.
Is there any sort of one-line command I can run that will just shoot the information I'd like added to a row into this database? I don't understand why it has to be this complicated...
EDIT:
One of the answers was to drag an instance of the dataset onto the form.
After doing this, and trying to reference it, I'm now getting an error message telling me :
"Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.
This message appears under the autocorrect options, and gives me the option to replace the dataset I added to the form, RDataSet1, with RDataset.
When hovering over the code "RDataSet1.ArchivedIncidentsDataTable.NewRow()", I still see the error message "Object Reference requires an object reference".
The message
object reference to non-shared object requires an object reference
means you're trying to access a member of a class like it's a shared member, but it's not, so you need an actually instance of that class (an object reference).
If you're using WinForms, you can just drag a RDataSet onto your Form, and it should generate a field in your Form called RDataSet1 or something like that (I asumme you used the DataSet Designer of Visual Studio).
Then use RDataSet1 (the object reference) instead of RDataSet (the type).

SSRS custom code and variables life

I have a report that needs to process the data that it get from SQL before show it.
For that, I have a custom code, and a Dictionary where I push all the processed data.
My problem is that if I save the dictionary in a report variable when I export the report to Word that variable seems to be cleaned.
What is the lifecycle of the reports variables? What is the most convenient way of saving an object during the report life.
Thanks!
I have been playing around with custom code for a about 6 weeks so I can answer some parts of the question of variable lifecycle in SSRS 2008 R2.
I have report that uses a Dictionary to store totals, allows me provide some specialist subtotals for financial stuff. I have something you can check (as I can't yet comment on things).
Have you declared the variable as 'shared', this is a custom code specific keyword that doesn't translate into VB.net. It ensures the variable lives to the next page, I tested this to Excel and word seemed to work fine transferring over the variable's data.
There is a trade off however under SSRS "report on demand" engine (on web, but not on BIDS) it holds the variable and doesn't garbage collect until the cache itself is cleared. I wrote some more custom code to indicate when my parameters changed and clears the variable.
Code;
Public Shared Dim Totals As New System.Collections.Generic.Dictionary(Of String, Decimal)
Public Function WipeKeys() as Decimal 'Clear Data from Dictionary (this will clear the cached object as well)
Totals.Clear()
Return 0D
End Function
I will also to recommend overwrite the key where ever possible to ensure reduction of addition loops.
Regards,

What to replace in Crystal Report Programmatically?

I have a line of code to set the Report.PrintDate in VB6.How can we replace this line for CrystalDecisions.CrystalReports.Engine.ReportDocument ? In VB6 we have it is the inbuilt property for CRAXDRT.Report.
So can any once help me regarding this ?
if you want to show the current Date/Time of the printed report, you can use the built in Special Fields within the report designer . From your comment I understand you want to set that programatically. Then you need to create a Parameter and set it from code.
You can watch this DEMO to get to know how to create parameters. This Answer would show you how to pass the parameter from code.