VBF syntax for SSRS expression cannot figure out proper construct - visual-studio-2012

looking for help on what should be a very basic function. I am trying to get a SUM of a specific value, however I do not seem to get the syntax correct.
Here is what I have
=Sum(Fields!PriorYearSalesDollars.Value - Sum(Fields!PriorYearCost.Value
+Sum(Fields!PriorYearFrtCost.Value)))
However I get an error when trying to sum. Is there another way to test this also? Each time I modify the expression I then have to save the report and upload to the report server and test again. If I do it through the preview function in visual studio it throws a generic error on the whole report. When running from report server, just this specific column shows #Error

This is the syntax that works after FIRST changing the column format to numbers where I accidentally did it as currency first. Not sure why currency didn't work, but this is correct.
=Sum(Fields!PriorYearSalesDollars.Value) - (Sum(Fields!PriorYearCost.Value) + Sum(Fields!PriorYearFrtCost.Value))

Related

How do I filter a Job Estimates vs. Actuals report by customer: job name in QuickBooks Desktop SDK using QBFC?

I have modified some VB sample code to get most of what I need done using the QuickBooks SDK in an app launched from Excel using VBA. I am able to produce both a Time by Job Summary report and a Job Estimates vs. Actuals report, but for the latter I need to produce filtered copies of it for each customer:job reference number, and I'm not sure what the proper syntax is for this even after looking over the specific query in the API Reference for QB Desktop.
I'm fairly sure that this needs to be done during the request phase. Also, I'm using QBFC, so I have tried various combinations that seem logical, but still haven't received the desired output. If it helps, an example of what is needed for the filter would be like: 20-5050 Dan Barton Trucks. Below is my code for the request:
Set jobRQ = requestSet.AppendJobReportQueryRq
customerRef = "20-5050 Dan Barton Trucks"
With jobRQ
.JobReportType.SetValue ENJobReportType.jrtJobEstimatesVsActualsSummary
.ReportEntityFilter.ORReportEntityFilter.EntityTypeFilter.SetValue etfCustomer
' .ReportEntityFilter.ORReportEntityFilter.FullNameList.Add (customerRefID)
.ORReportPeriod.ReportPeriod.FromReportDate.SetValue dateFrom
.ORReportPeriod.ReportPeriod.ToReportDate.SetValue dateTo
.SummarizeColumnsBy.SetValue scbTotalOnly
.IncludeSubcolumns.SetValue True
.DisplayReport.SetValue True
End With
I have commented out the line that doesn't work.

Cross Object References Workfront text editor

Hello I am attempting to link data that is connected to a task on a project report using the text editor.
So far I have this as my code:
displayname=Recvd Medical Rates
linkedname=project:tasks
namekey=DE:Documentation Received Date
querysort=project:tasks:Document - Medical Rates:Documentation Received Date
textmode=true
valuefield=Documentation Received Date
valueformat=customDateAsString
I need to display data from a specific task within a specific custom form on a project report. I know there is no standard method of linking a project with a task, but the relationship is there and from my research It seems possible. I believe that I do not have the correct syntax.
Can somebody please help me with this. I have tried all types of combinations, I even tried adding the aggregator:
aggregator.displayformat=customDateAsString
aggregator.function=MIN
aggregator.namekey=Documentation Received Date
aggregator.valuefield=DE:Documentation Received Date
aggregator.valueformat=customDateAsAtDate
Either way I try and link the information the actual entered data will not display. So far the report knows that it is a date field; I know this because I am able click into the field on the project report and choose a date, but the date will not remain selected once I have chosen it leading me to believe that the field is somehow linked, but done incorrectly.
Please help.
The answer is below:
displayname=Plans and Benefits Received
listdelimiter=
listmethod=nested(tasks).lists
textmode=true
type=iterate
valueexpression=IF(CONTAINS("Plans and Benefits",{name}),{actualCompletionDate})
valueformat=HTML
So how does it work? see below.
displayname=Plans and Benefits Received
^display name that you want^
listdelimiter=
^decides delimiter^
listmethod=nested(tasks).lists
^Calls the nested or sub task^
textmode=true
^allows text editor mode to function^
type=iterate
^make data display as an iteration of original^
valueexpression=IF(CONTAINS("Plans and Benefits",{name}),{actualCompletionDate})
^determines where the data is being pulled from^
valueformat=HTML
^Format set to HTML^

Using AND and OR together on the IF function

Hi all I have been trying to fin out how to use AND and OR together on the same formula.
I'm trying to resolve the following issue :
The person will get a discount only if they are working on the Cerrovial project or if they are working on the Parinas project but the risk of the job must be Low
I tried to use a formula and excel gave me an error and also fixed my formula but I do not know if this is correct or what the "*" means
=IF(OR(D14="CerroVial",D14="Parinas")*AND(E14="Low"),"8%","")
You were close:
=IF(AND(OR(D14="CerroVial",D14="Parinas"),E14="Low"),"8%","")
All the elements of the AND need to be in the AND(...), just like for the OR, which you had done correctly.

Excel in SSIS: How to import a column that may have more than 255 characters when DT_NTEXT causes failures?

OK, so my latest project requires loading an Excel 2007 spreadsheet into a SQL Server table. I'm working in SSIS 2008R2. Based on some stuff I found on the internet, I opened the Excel source in Advanced editor and changed the datatype of the long column to DT_NTEXT, so that it wouldn't truncate it. Then I made the database column VARCHAR(MAX). This runs correctly in debug mode on my laptop.
Then I deployed it to the development server and attempted to load the same test file. It failed with the following error messages:
Error: Code: 0xC0208265
Source: Main Data Flow Task Get Main Data [1]
Description: Failed to retrieve long data for column "DESCR".
End Error
Error: Code: 0xC020901C
Source: Main Data Flow Task Get Main Data [1]
Description: There was an error with output column "DESCR" (72) on output "Excel Source Output" (9). The column status returned was: "DBSTATUS_UNAVAILABLE".
End Error
Error: Code: 0xC0209029
Source: Main Data Flow Task Get Main Data [1]
Description: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "output column "DESCR" (72)" failed because error code 0xC0209071 occurred, and the error row disposition on "output column "DESCR" (72)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
End Error
Searching for information about the error, I found about a million sites offering the same three suggested solutions:
Add 'IMEX=1' to the extended properties of the connection string.
It was already there.
Change the TypeGuessRows key in the registry.
This was set to zero on the server, which I understand to mean that it should look at the entire file. Nevertheless, I changed it to 8 to match my laptop. The same error occurred when I ran it again. Then I changed it to 1,763, which is more than the number of rows in the spreadsheet. It still gave the same error. So, I put it back to zero. (There's a 1,900-character value in the first row of my test file, so it shouldn't really matter how many it checks, in this case.)
Change the datatype to DT_WSTR(4000) in the source.
The column is supposed to have up to 10,000 characters, so I'm not sure this would be a good idea even if it worked. However, I tried it anyway. This time it gave me a truncation error. I changed the truncation error disposition to "ignore failure" and it loaded the data, but truncated the value to 255 characters. I have verified that the length is 4000 and doesn't get changed when I save the file, but it's still truncating at 255 characters.
I have no idea what else to look at. Any help would be appreciated.
UPDATE 1/29: The package, without any changes, works correctly when running on the pre-production server. It still fails when running on the development server. Both servers have the same version of SSIS (including minor version numbers) as well as the same versions of Windows, Access and Excel. I do not know how to explain this, nor do I know how to tell if it would work in production.
I created a new package with similar non-functional requirements (Excel 2007 file, SSIS 2008, SQL Server 2008 R2, VARCHAR(MAX) target column) and it worked just fine after deployment into the database server. My package:
Metadata at the Excel Source component's output (checked using Advanced Editor): DT_NTEXT
Derived Column component between source and destination to cast to non-unicode from unicode using (DT_TEXT,1252)
Metadata at the OLE DB Destination component's input (checked using Advanced Editor): DT_TEXT
Target Column data type: VARCHAR(MAX)
I do not explicitly use the extended property IMEX in the connection
Executed by right-clicking on the package at the database server, and loaded a file with a few thousand characters per record into the table without truncation. Hope this helps
I have faced this issue while importing an excel file with a field containing more than 255 characters. I solved the issue using Python.
Simply, import the excel in a pandas data frame and then calculate the length of each of those string values per row.
Then, sort the dataframe in descending order. This will enable SSIS to allocate maximum space for that field as it scans the first 3 rows to allocate storage:
df = pd.read_excel(f,sheet_name=0,skiprows = 1)
df = df.drop(df.columns[[0]], axis = 1)
df['length'] = df['Item Description'].str.len()
df.sort_values('length', ascending=False, inplace=True)
writer = ExcelWriter('Clean/Cleaned_'+f[5:])
df.to_excel(writer,sheet_name='Billing',index=False)
writer.save()

querysting binding error when using ServiceStack version 4.0.34 and OrmLiteCacheClient

We're getting an "unable to bind to request" when calling a service with the following querystring:
/SomeService?playerid=59326&fromdate=4-1-2014&todate=12-11-2014
We have been using this querysting format for awhile now.
The problem is some either a change in 4.0.34, or something in the OrmLightCacheClient, which we had turned off for awhile and only just recently turned it back on.
If I change the dates to following format, it seems to work.
/SomeService?playerid=59326&fromdate=2014-4-1&todate=2014-12-31.
We can roll with the changed querystring date format for now, but wanted to report the error.
When supplying a date only (i.e. doesn't include a time) it should be unambiguously defined using the YYYY-MM-DD format.

Resources