Showing posts with label attempting. Show all posts
Showing posts with label attempting. Show all posts

Sunday, March 11, 2012

Cascading Parameter issue with RS2005... It worked in RS2000

Our company is attempting to convert several RS2000 reports to RS2005. We have 4 default parameters on every report.

1) Date Range (dropdown) – populated via Non-Queried Available values (Ex. Today, Week to Date, Month to Date, Fiscal Period)
2) Fiscal Period (cascading dropdown) – populated via Query Available values (if Date Range = ‘Fiscal Period’, select the last 24 fiscal months, else select Date Range value)
3) Start Date (cascading textbox) – populated via Query Default values (depending on Fiscal Period value calculate Start Date)
4) End Date (cascading textbox) – populated via Query Default values (depending on Fiscal Period value calculate End Date)

The user starts by selecting a Date Range which auto populates the Fiscal Period the auto populates the 2 Date textboxes. This works great in RS2000; however it’s not 100% in RS2005. Here’s what happens:

If a user selects ‘Today’ or ‘Month to Date’ in Date Range, everything works fine. At this point there is only 1 value in Fiscal Period dropdown. If the user selects ‘Fiscal Period’ in the Date Range, the Fiscal Period is populated with 24 values (1 for the last 24 fiscal months) and is set to the top value (June – 2006). The 2 Date textboxes are also populated correctly.

The problem is when the user changes the value in the Fiscal Period dropdown. Let's say the pick 'Mar - 2004'. The 2 Date fields are not refreshed or updated. If the user changes the selection back in the first dropdown (Date Range), everything is refreshed and updated appropriately. I don’t under stand why the first dropdown will refresh all the dependent parameters but the second dropdown won’t refresh the 2 Date fields below it?

Any input would be very helpful. I’ve tested this on 3 different development boxes and 2 different RS2005 servers. All tests had the same results.

Thanks,
Nick

Any ideas why this thing works in RS2000, but not in RS2005? Any input would be valued. Thanks,

Nick

Thursday, March 8, 2012

Cascade Delete Question

I am attempting to clarify how the cascade delete works. For example I have a Parent table and two child tables used for lookup that have the ID_FK = ID_PK from the Parent table.

tblUsers
-----
ID_PK
Fname
Lname
...

tblUser_Phone
------
ID_FK
Phone
...

tbUser_Email
------
ID_FK
Email
...

If I needed to delete all records from tblUser_Phone would this delete my USER entry from the parent table tblUsers if I have cascade delete enabled?

Thanks in advance.I believe cascade delete only deletes children records, so the parent table would be safe.|||I believe you are correct. Cascading only travels down the hierarchy, not up.

Sunday, February 12, 2012

Can't use Package Variable to specify the filename for a Connection

I'm attempting to modify a flatfile import package so that I can reuse it to import several other files into the same table. I was unable to use package variables (containing the import filename) in the Flat File Connection Manager file name field. What is the proper way to solve this kind of problem in SSIS?Have you looked up property expressions in BOL? Give that a look.
http://sqljunkies.com/WebLog/knight_reign/archive/2005/02/12/7750.aspx
Thanks,
K|||

I setup a ForEach Loop Container to do this.

Create a Package Variable, for example, "varFileName", for the FileName. Then edit the ForEach Loop container. Select "Variable Mappings". Select the drop-down under the "Variable" column and select your "User: varFileName" variable. The index column should read "0". Save the object. Now add a Data Flow task and double-click to edit.

In the Data Flow window, create a Source Script transformation. Define your output columns on the "Inputs and Outputs" option. Click "Script" and add your variable "varFileName" to the property "ReadOnlyVariables". Now click the "Design Script" button, which opens up another window for scripting.

Add "Imports System.IO" to the top so you can read the flat file.

Read the file with the following code:

Dim strRecord as String
Dim objFlatFile As StreamReader = File.OpenText(Variables.varFileName)
Do Until objFlatFile.Peek = -1
strRecord = objFlatFile.ReadLine
[OutputBuffer].AddRow()
[OutputBuffer].[Column1] = Mid$(stRecord,1,4)
... etc.
Loop

Let me know if this helps...