Showing posts with label box. Show all posts
Showing posts with label box. Show all posts

Wednesday, March 21, 2012

Group Test Field

When adding a text box in my group section, the textbox width is limited to the width of the first column in the detail of the report, or any detail column. It cannot span multiple columns, even though it is the only textbox on the entire 8 inch line, it is limited to my .5 inch column 1 width.
How do I expand my group by text box to use some of that empty space ?
Thanks in advance,
ChrisFigured it out, right-click on the cell select Merge Cells and can spread across entire row. Nice!
I'm a huge fan!
Chris
"Chris" wrote:
> When adding a text box in my group section, the textbox width is limited to the width of the first column in the detail of the report, or any detail column. It cannot span multiple columns, even though it is the only textbox on the entire 8 inch line, it is limited to my .5 inch column 1 width.
> How do I expand my group by text box to use some of that empty space ?
> Thanks in advance,
> Chris

group page break adding blank pages

I have a report that I am grouping the data and setting the page to break
after each group (check box "Page break at end"). When I View Report in
Preview, the report looks perfect. Four pages, four groups. In this case,
each group fits on one page. When I click on the magnifying glass to see the
print view, it returns 8 pages. There is a completely blank page (except for
page header) on every even page. This is the case when a group goes to two
pages as well. If I run the report and get 5 pages with 4 groups, I still
get 10 pages when viewing for printing.
How can I keep the page break and get rid of the extra page? This is really
bad when the report is over 1000 pages... making it over 2000 pages for
nothing."SharinDenver" <SharinDenver@.discussions.microsoft.com> wrote in message
news:0F2CDB4D-6130-4D9B-A382-028941BCA3CF@.microsoft.com...
>I have a report that I am grouping the data and setting the page to break
> after each group (check box "Page break at end"). When I View Report in
> Preview, the report looks perfect. Four pages, four groups. In this
> case,
> each group fits on one page. When I click on the magnifying glass to see
> the
> print view, it returns 8 pages.
Hi Sharin,
Try to figure out what element is causing this behavior. In general if you
set to invisible only one element and everything will get in order. Find the
wrong element and then look for problems in it.
Regards,
--
Martin Kulov
http://www.codeattest.com/blogs/martin
MCAD Charter Member
MCSD.NET Early Achiever
MCSD|||I tried setting each element to hidden one at a time and nothing changed.
I finally got it to stop happening though. My page width property is 5.5
inches. For an 8 inch page with half inch margins. I'm wasting all that
space. But if I make my page 5.5 inches (and therefore my table has to fit
in that), then it doesn't happen anymore. Any suggestions on why this is
happening?
"Martin Kulov" wrote:
> "SharinDenver" <SharinDenver@.discussions.microsoft.com> wrote in message
> news:0F2CDB4D-6130-4D9B-A382-028941BCA3CF@.microsoft.com...
> >I have a report that I am grouping the data and setting the page to break
> > after each group (check box "Page break at end"). When I View Report in
> > Preview, the report looks perfect. Four pages, four groups. In this
> > case,
> > each group fits on one page. When I click on the magnifying glass to see
> > the
> > print view, it returns 8 pages.
> Hi Sharin,
> Try to figure out what element is causing this behavior. In general if you
> set to invisible only one element and everything will get in order. Find the
> wrong element and then look for problems in it.
> Regards,
> --
> Martin Kulov
> http://www.codeattest.com/blogs/martin
> MCAD Charter Member
> MCSD.NET Early Achiever
> MCSD
>
>|||I'm having the same issue. I have a group that does a page break the
customer. That field is hidden. The only way I can get the blank page to
not print is to remove the page break in the table group. Is there a way to
have a page break and not have that blank page print?
"Martin Kulov" wrote:
> "SharinDenver" <SharinDenver@.discussions.microsoft.com> wrote in message
> news:0F2CDB4D-6130-4D9B-A382-028941BCA3CF@.microsoft.com...
> >I have a report that I am grouping the data and setting the page to break
> > after each group (check box "Page break at end"). When I View Report in
> > Preview, the report looks perfect. Four pages, four groups. In this
> > case,
> > each group fits on one page. When I click on the magnifying glass to see
> > the
> > print view, it returns 8 pages.
> Hi Sharin,
> Try to figure out what element is causing this behavior. In general if you
> set to invisible only one element and everything will get in order. Find the
> wrong element and then look for problems in it.
> Regards,
> --
> Martin Kulov
> http://www.codeattest.com/blogs/martin
> MCAD Charter Member
> MCSD.NET Early Achiever
> MCSD
>
>sql

Sunday, February 19, 2012

Gridview Search

I tried doing a text box search within Gridview. My code are as follows. However, when I clicked on the search button, nothing shown.

Any help would be appreciated. I'm using an ODBC connection to MySql database. Could it be due to the parameters not accepted in MySql?

Protected

Sub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)

SqlDataSource1.SelectCommand =

"SELECT * FROM carrier_list WHERE carrierName LIKE '%' + @.carrierName + '%'"

EndSub

Sub doSearch(ByVal SourceAsObject,ByVal EAs EventArgs)

GridViewCarrierList.DataSourceID ="SqlDataSource1"

GridViewCarrierList.DataBind()

EndSub

HTML CODES (Snippet)<asp:ButtonID="btnSearchCarrier"runat="server"onclick="doSearch"Text="Search"/>

' Gridview
<asp:GridViewID="GridViewCarrierList"runat="server"DataSourceID="SqlDataSource1">

</asp:GridView>

<

asp:SqlDataSourceID="SqlDataSource2"runat="server"ConnectionString="<%$ ConnectionStrings:ConnectionString %>"ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"SelectCommand="SELECT * FROM carrier_list"></asp:SqlDataSource>

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:ConnectionString %>"ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"><SelectParameters><asp:ControlParameterControlID="txtSearchCarrier"Name="carrierName"PropertyName="Text"Type="String"></asp:ControlParameter></SelectParameters>

</asp:SqlDataSource>

It's a syntax error on your SQL statement.

Try this:

SqlDataSource1.SelectCommand = "SELECT *FROM carrier_listWHERE carrierNameLIKE'%" + @.carrierName + "%'"
You had an extra ' after first '% and before last %'
Hope this helps and let me know if it worked.
Jae.
|||

It reverted with a :

"Character is not valid." error.

Line 33: SqlDataSource1.SelectCommand = "SELECT * FROM carrier_list WHERE carrierName LIKE '%" + @.carrierName + "%'"

|||

check what your server is passing to sqldatasource by doing following:

response.write("SELECT * FROM carrier_list WHERE carrierName LIKE '%" + @.carrierName + "%'")

it print out:

SELECT * FROM carrier_list WHERE carrierName LIKE %yourvalue%

Also, note that your value (carrierName) should not contain any single quote or double quote.

Hope this helps.

Jae.

|||

check what your server is passing to sqldatasource by doing following:

response.write("SELECT * FROM carrier_list WHERE carrierName LIKE '%" + @.carrierName + "%'")

it print out:

SELECT * FROM carrier_list WHERE carrierName LIKE '%yourvalue%'

Also, note that your value (carrierName) should not contain any single quote or double quote.

Hope this helps.

Jae.

|||

Hi it still prompts the same error:

response.write(

"SELECT * FROM carrier_list WHERE carrierName'%" + @.carrierName + "%'")|||

i just looked at your code from beginning again.

1. it's VB, so why should you use +? instead of &? (sorry i thought of C#)
2. you're mising LIKE on above statement.
3. you can't LITERALLY pass @.carrierName as value. Your value is txtSearchCarrier.text
4. I don't understand why you have 2 sqldatasource (Delete sqldatasource2 - this will show same effect, read on)

So, let's write it again and clean up a bit:

SqlDataSource.SelectCommand = "select * from carrier_list where carriername like '%" & txtSearchCarrier.text & "%'"

Also, you don't need <controlparameter> tag within "select parameter", try this approach:

HTML CODES (Snippet)

<asp:Textbox id="txtSearchCarrier" runat="server"/>
<asp:Button ID="btnSearchCarrier" runat="server" onclick="doSearch" Text="Search" />

' Gridview
<asp:GridView ID="GridViewCarrierList" runat="server" DataSourceID="SqlDataSource1" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" />

That's it.

This will show ALL carriers like you had with sqldatasource2, but with only one sqldatasource1 (because it will pass like '%%' whichi will return all)
*** Also, when carrier name is typed into txtSearchCarrier (obviously a textbox), it will return result sets with characters displayed in textbox.
*** Also, you should have your LOAD_PAGE empty.

If you don't want to diplay anything at first, don't bind DataSourceID = "sqldatasource1", but rather do it on btnSearchCarrier_OnClick handler.
Something like this:

sub btnSeachCarrier_OnClick (....)
.... you other code ...
gridViewCarrierList.datasourceid = "sqlDataSouce1"
gridViewCarrierList.databind()
end sub

This way, you only retrieve data when you click "searchcarrier" button.

Hope this helps and if it doesn't send me the aspx page and I will help you with it. (send it to my email,jae.lee@.jaeleeandco.com)

Jae.

|||

just in case, you HAVE to do following:

1. delete PAGE_LOAD

2. add select command to on_click look at below:

sub btnSeachCarrier_OnClick (....)
.... you other code ...
SqlDataSource.SelectCommand = "select * from carrier_list where carriername like '%" & txtSearchCarrier.text & "%'"
gridViewCarrierList.datasourceid = "sqlDataSouce1"
gridViewCarrierList.databind()
end sub

|||

Thanks Jae,

Actually I used

SqlDataSource1.SelectCommand ="SELECT * FROM carrier_list WHERE carrierName LIKE ? '%' ORDER BY carrierName ASC"

instead and it works.

Will try your suggestion too! Thanks!