How do you reference a field in the Embedded Code of an SSRS report - sql-server

Is there a proper way to reference the fields of a ssrs report from the embedded code of an ssrs report?
When I try to use Fields!Program.Value I get the following error --
There is an error on line 3 of custom code: [BC30469]
Reference to a non-shared member requires an object reference.
Upon googling I found you could reference the Parameters of a report by prepending Report. at the beginning. So I tried this Report.Fields.Program.Value.
That results in the following error...
There is an error on line 3 of custom code: [BC30456] 'Fields' is not a member of 'Microsoft.ReportingServices.ReportProcessing.ExprHostObjectModel.IReportObjectModelProxyForCustomCode'.
So... in summary, is there a way to reference the fields from the embedded code. I figured out I could pass the field vals to the function itself but I would prefer to reference the fields directly.
Seth

You have to pass it in as a parameter.
=Code.ToUSD(Fields!StandardCost.Value)

You do have two other alternatives to passing by parameter, though neither is very pretty.
(Beware! After I wrote the following paragraph I discovered defaults from queries are not supported in local processing mode so this first solution may not be viable for you as it was not for me.)
You can create a hidden report parameter with a default value set from a dataset, then reference this with the Report.Parameters!MyParam.Value syntax. You have to be careful when testing this, as (at least in BI studio 2005) the report parameters don't seem to get reliably re-initialised from the DB in the Preview tab.
Alternatively you can create a hidden textbox on the report with its text set from a dataset, and then reference the textbox from code. In this case you have to pass the ReportItems object as a parameter, but the slight advantage is that it is only ever one extra parameter. Be sure to strongly type the parameter when declaring it:
public Sub MyCustomCode(ri as ReportItems)
The code will work in BI studio without the type declaration but for me it caused errors with the report viewer control in local processing mode if 'as ReportItems' was not present.
In either case, this is only really useful for page level data, so functions for use in a table should still take parameters.

Related

VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT on swapchain ImageViews

I updated my nVidia drivers and suddenly started getting the following validation error:
VUID-vkCmdDrawIndexed-blendEnable-04727(ERROR / SPEC): msgNum:
-1979288290 - Validation Error: [ VUID-vkCmdDrawIndexed-blendEnable-04727 ] Object 0: handle =
0x5eb05e000000003b, type = VK_OBJECT_TYPE_PIPELINE; | MessageID =
0x8a06751e | vkCmdDrawIndexed: Image view's format features of the
color attachment (0) of the active subpass do not contain
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT bit, but active
pipeline's pAttachments[0].blendEnable is not VK_FALSE. The Vulkan
spec states: If rasterization is not disabled in the bound graphics
pipeline, then for each color attachment in the subpass, if the
corresponding image view's format features do not contain
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT, then the blendEnable
member of the corresponding element of the pAttachments member of
pColorBlendState must be VK_FALSE
(https://vulkan.lunarg.com/doc/view/1.3.211.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-blendEnable-04727)
Things still render correctly, but I'd like to fix the validation issue.
I am a bit confused as to how I set the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT flag or if its part of the format vkGetPhysicalDeviceSurfaceFormatsKHR returns.
If it's the former, how do i set it and if it's the latter, how do i draw to it with blending enabled and not get validation errors?
Thank you!
Format features are not something you set; they're limitations that the Vulkan implementation informs you that you must work within. In particular, format features are properties that restrict how you may use any image with a particular combination of format, tiling, and so forth.
Swapchain images are subject to the same limitations as user-created images. The specification details what the equivalent VkImageCreateInfo would be for a particular vkCreateSwapchainKHR call. So those are the parameters you will need to send to vkGetPhysicalDeviceFormatProperties to see if your implementation supports some particular use of the swapchain image.
Blending is such a use. Apparently, whatever format you used to use allowed blending under the old driver, but this changed. And your code never verified that it was allowed.
Well, I missed another validation error that gave me the clue to find the issue. I had to update the VkApplicationInfo apiVersion to VK_API_VERSION_1_3. Leaving the answer here in case it helps anyone else.

How to use Environment File in SSIS Job Step Property

Created a package and deployed on SQL Server 2017. my package is having parameters (package level scope) and want to set values from environment file at the time of create a SQL-JOB-STEP.
I have created environment file and defined my variables perfectly "Integration Services Categolog => SSISDB => MyProject => Environments" and those variables can be assigned at the time of configure & execute to my package parameters which is working well.
but I cannot do the same while create SQL-JOB. I can see in "step properties window" there is a option to locate "Environment" file but when I locate the file then I cannot find the way to assign those variables to my package's parameters. can anyone help me in this please?
please refer picture:
Click the ellipses (...) besides the empty Value spot. There you will be presented with three options (if you didn't have an Environment established, there'd be only two).
The design time value is the default here. If your parameter, MyVar01_PackageLevel, had an actual value displayed, the UI would render it in the default font weight/style.
One row above is a manual override radio button and here you can just hard code the value. Doing this will result in the Value displayed to be in bold
One row below the design time value is where you can associate a parameter to a list of parameter values from your Environment. Scroll through the list of values, which are in no discernible order, and find the target property name. Let's call it V01_PL After selecting that, the above will indicate V01_PL in an italicized font. It won't show the value of V01_PL mind you, it'll just tell you it's driven the configured value.

Grails 3 "show" view with Fields plugin 2.1.0-SNAPSHOT

Stuck at a trivial problem in Grails 3.1.5: Show the fields of a domain object, excluding one of them, including a transient property. Yes, this is my first Grails 3 project after many years with previous versions.
The generated show.gsp contains
<f:display bean="rfaPdffile"/>
This will include a field that may contain megabytes of XML. It should never be shown interactively. The display: false constraint is no longer in the docs, and seems to be silenty ignored.
Next I tried explicitly naming the fields:
<f:with bean="rfaPdffile">
<f:display property='fileName'/>
<f:display property='pageCount'/>
...
</f:with>
This version suprisingly displays the values without any markup whatsoever. Changing display to field,
<f:with bean="rfaPdffile">
<f:field property='fileName'/>
<f:field property='pageCount'/>
...
</f:with>
sort of works, but shows editable values. So does f:all.
In addition I tried adding other attributes to f:display: properties (like in f:table), except (like in f:all). I note in passing that those two attributes have different syntax for similar purposes.
In the Field plugin docs my use case is explicitly mentioned as a design goal. I must have missed something obvious.
My aim is to quickly throw together a prototype gui, postponing the details until later. Clues are greatly appreciated
If I understood you correctly, you want to have all bean properties included in the gsp but the one with the "megabytes of XML" should not be displayed to the user?
If that is the case you can do:
f:with bean="beanName"
f:field property="firstPropertyName"
f:field property="secondPropertyName"
And the one you don't wish to display:
g:hiddenField name="propertyName" value="${beanName.propertyName?}"
f:with
So list all the properties as f:field or f:display and put the one you don't wish to display in a g:hiddenField Grails tag
You can also try:
f:field property="propertyName"
widget-hidden="true"
but the Label is not hidden in this case.
Hope it helps
My own answer: "use the force, read the source". The f:display tag has two rather obvious bugs. I will submit a pull request as soon as I can.
Bugs aside, the documentation does not mention that the plugin may pick up the "scaffold" static property from the domain, if it has one. Its value should be a map. Its "exclude" key may define a list of property names (List of String) to be excluded. This probably works already for the "f:all" tag; bug correction is needed for the "f:display" tag.
My subjective impression is that the fields plugin is in a tight spot. It is intertwined with the Grails architecture, making it sensitive to changes in Grails internals. It is also required by the standard scaffolding plugin, making it very visible. Thus it needs constant attention from maintainers, a position not to be envied. Even now conventions for default constraints seem to have changed somewhere between Grails 3.0.9 and 3.1.7.
Performance of the fields plugin is sensitive to the total number of plugins in the app where it is used. It searches all plugins dynamically for templates.
For the wish list I would prefer stricter tag naming. The main tags should be verbs. There are two main actions, show and edit. For each action there are two main variants, single bean or multiple beans.
My answer is that at present (2 March 2017) there is no answer. I have searched the Net high and low. For the index (list) and create and edit views, the fields plugin works well enough. A certain field can be easily excluded from the create and edit views, relatively easily from the list view (by listing those that should show), and in no way I could find from the show view. This is such a common need that one would suspect it will be addressed soon. Also, easily showing derived values in the show view, like 'total' for an invoice. One can do that by adding an ordered list with a list item showing the value below the generated ordered list of values, but that is kind of a hack.
In some ways, the old way was easier. Yes, it generated long views, but they were generated and didn't have to be done by the programmer - just custom touches here and there.

Error when adding user-defined control to a form.

I have an user-defined control which includes a property ElementList of IList<WFParament> type. When I add my control into a form, I get the error:
"WorkFlowDesign.WFParament[]" can't be transfered into "WorkFlowDesign.WFParament[]"
Does your usercontrol do anything on load? If so, try wrapping it in:
if(!DesignMode)
{
//Do something
}
I would verify that you don't have two versions of the assembly containing the type WorkFowDesign.WFParament loaded/referenced. This could happen if your project where you are using the user control references one version of the assembly while the user defined control is compiled against a different version. If this is the case you will need to update one of the two so that they are referencing the same version of the assembly containing WorkflowDesign.WFParament.

DataBinding error -DataGridView in Winforms

I'm new to VB.NET, Windows Application, and DataGridView.
This is a very basic error which I'm suffering now. I have a stored procedure to retrieve data from the database. I stored those data in a DataSet and tried to view it in a DataGridView. I used this code for databinding which is throwing the error:
DataGridView1.DataSource=ds
DataGridView1.DataBindings()
The second line in the code is throwing an error:
Property access must assign to the property or use its value.
How can I solve this?
There is no DataGridView1.DataBindings() when dealing with Winforms, it's practical in Webforms.
Just remove the last line and leave the following:
DataGridView1.DataSource=ds
Perhaps you meant:
DataGridView1.DataSource=ds
DataGridView1.DataBind()
EDIT :
You haven't provided enough code to check that everything is in place, but I suggest you work your way through this: http://msdn.microsoft.com/en-us/library/fbk67b6z.aspx
use DataGridView1.Databind()
hope that helped...

Resources