Showing posts with label ide. Show all posts
Showing posts with label ide. Show all posts

Monday, March 26, 2012

How to anchor data regions

I have a couple of textboxes on a report that are just where I want them.
When I preview the report in the IDE, they are where they are supposed to be
but when I deploy the report and view it from the report server they float
down to the middle of the screen. How do I fix this ?Try placing them in a Rectangle. If the textboxes overlap, they will move
around when rendered to HTML.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"PeteMitchell" <PeteMitchell@.discussions.microsoft.com> wrote in message
news:9BFCEEEA-25B7-4845-A045-36491057DB2E@.microsoft.com...
>I have a couple of textboxes on a report that are just where I want them.
> When I preview the report in the IDE, they are where they are supposed to
> be
> but when I deploy the report and view it from the report server they float
> down to the middle of the screen. How do I fix this ?

Wednesday, March 7, 2012

How to add a variable in Source view ?

There are 3 views in VS IDE, Designer, Code and Source.

In source view, there are html codes, how do I add a variable into it ?

For example:

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:JJConnectionString %>"
SelectCommand="SELECT * FROM [Tbl]"

...

How to change the SelectCommand to like:

SelectCommand="SELECT * FROM [Tbl] WHERE [CREATEDBY] = '" & User.Identity.Name & "'"

The User.Identity.Name is not valid in source view, but i need it to work, are there any way ?

Hello my friend,

To use code within aspx/ascx files, you enclose it within <% %> tags. The page directive at the top of your aspx pages is an example of this.

<%@. %> is for directives

<%= %> is for simple printing of code/variables. Try this on your web page: -

<%

=User.Identity.Name %>

<%# %> is for pre-processing but usually used in binding controls to print/use fields of the data source: -

<asp:Repeater ID="rptCountries" runat="server" Visible="true">
<ItemTemplate>
<td width="200"><%# Container.DataItem("CountryName")%><br/>
</ItemTemplate>
</asp:Repeater>

Kind regards

Scotty