I have no problem getting a GridView or ListView to page, normally. If I use Sql datasource and I use a query like:
SELECT RecipeName FROM PostedRecipes
and I enter Hot Dog, for example, in a search text box, and there are 40 Hot Dog recipes, the GridView/ListView will show page 1 with 10 recipes (if the count is set to 10) and show that there are 3 more pages to go. Each page then, page 2 or 3 or 4, will show additional recipes. However,
If I use a query like:
SELECT RecipeName FROM PostedRecipes
WHERE RecipeName LIKE '%' + #RecipeName + '%' GROUP BY RecipeName
and I make the same search entry, the GridView will show page 1 with 10 recipes and indicate that there are 3 more pages. BUT, if I click on page 2 or 3 or 4, a blank page is then displayed.
If I set the count to 40, all 40 recipes will be displayed on the initial search - which would indicate that all the recipes are being retrieved from the database. I am not sure if this is some sort of GridView problem or a postback problem of some sort. Any help would be appreciated.
Related
Hopefully you can help!
I have a single data source in my SSRS report. With this data source, I have populated a tablix. The tablix looks something like this:
SalesPerson ID Group Sales
Sarah 1 1 1234
Ross 2 1 555
Gemma 3 2 678
Jill 4 2 345
Jack 5 3 987
Peter 6 2 432
Henry 7 2 356
The report is set up to create a different page for each of the sales people. for example, on the first page of the report, only first record would be shown (the record that holds Sarah's information, the second page would show the record for Ross' information ,etc..)
The issues I face is this:
At the bottom of the report, I need to include a textbox that displays the group number that the specific employee belongs to (the employee who is currently being displayed on the page).
I think that I need to do some sort of lookup on the IDReportItem to return the group ID in order to do this, but have had no luck in my attempts.
I understand that this is a horrible way of doing things, but I am limited to using this single dataset for performing this task.
Any help you can provide will be greatly appreciated,
Thanks you!
Unfortunately there doesn't seem to be a way to do this in a single textbox, but you can do it with a second tablix that uses the same dataset.
Create your second tablix and position it at the bottom of the page, then set your grouping to be the same on both tablixes and use the second tablix to only display the group ID, plus whatever label you want.
Create a new row group for each tablix (grouping on group ID), then right click the group and browse to Group Properties -> Page Breaks and check the box that says "Between each instance of a group". Do this for both tablixes.
This is what grouping is designed for. Build your table, and set the page break attribute to true.
You can have multiple rows under your group. Since your group is a field, simply add it to the detail row.
Your grouping is obviously set up right to get the report paging correctly.
You could add a List to the report, set the grouping on that (with page break between groups)
Inside the list - Add a RECTANGLE. (this be important!)
Once you've added the rectangle, you can add another as many objects as you like. In your case I think that may be a matrix and a text box
eg
Then it just becomes as spacing issue (to get the page looking right)
Is it possible to set number of copies for page?
For example:
SELECT NAME, TYPE, QUANTITY FROM INFORMATIONS
SQL result:
Tom | house | 2
Mark| cars | 3
One page is for Tom and second page is for Mark.
Can i write SQL that will output me that many results as i want. (some for loop?)
I want to see in preview 2 pages for Tom(copies) and 3 pages for Mark. (5 pages to print)
Please, if you can past me sample code or pictures how to do it.
If you want to generate rows based on the quantity, you can do:
select i.*, generate_series(1, i.quantity) as n
from informations i;
This seems to be what you asking.
New to Access here... I asked a similar question the other day, but have a new twist for a different form I am creating.
Say I have a table (tblNamesAndValues) that looks like this:
Name Value
---- ----
Mary 100
Carrie 500
Terri 999
Gerrie 749
I have created a form that displays all four names and values.
My question is this: how can you make the form display only the names Mary and Terri and their values, and have the values in updateable textboxes? On top of that, is there any way to only display those two, and not the blanks underneath that allow new entries?
Thanks in advance...
You can filter the form or use a query instead of the table as table source:
select * from tblNamesAndValues where name = "Mary" or name = "Terry"
For disabling the blank line, just set the AllowAdditions property of the form to false.
Using Oracle APEX v4.2.2, I would like to dynamically build a checkbox selection list based on data from an Oracle Classic Report.
For example:
Location Dept A. Dept. B Dept. C Total Employees
----------------- ----------- ----------- ------------ ---------------
Paris 5 10 3 18
Using the above report, I would like to dynamically build three checkboxes based on the columns Dept. A, Dept. B and Dept. C
So beneath my report I would expect to see checkboxes:
[]Dept. A []Dept. B []Dept. C
Obviously if my report only returned just Dept. A then I would expect to see just one checkbox:
[]Dept. A
Two ways to do it:
1) If the number of checkboxes are (a) known and (b) small, you can create each checkbox and make it conditional on an associated hidden page item (say :PXX_DEPTA_COUNT). Then you can have each of those hidden items either their value using 'Always / SQL Query', or they can be set all at once via a Page Process.
2) You can also create a PL/SQL dynamic content region, and use the apex.item API to create the checkboxes:
http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_item.htm#AEAPI1006
If you go with the dynamic content region, you're going to have to do the HTML work yourself, but you can cheat by first creating a test region with some checkboxes laid out the way you want, then look at the page source and use the same HTML in your dynamic region.
I'd like to ask Postgres how often two occurrences of an event, one occurrence per row, are seen. For example, if I have user events like:
User 1: Clicked button 1, redirected to page 2
User 1: Clicked button 2, redirected to page 3
User 1: Clicked button 18, redirected to page 100
User 1: Clicked button 1, redirected to page 2
User 1: Clicked button 2, redirected to page 3
then I would see the pattern ((button 1, page 2) => (button 2, page 3)) counted as two occurances.
Is this possible, and if so, how?
It's a very good question and has a fairly simple solution. Use GROUP BY and HAVING to find out which user shows what sort of repeated behavior.
Please see the fiddle example here which discusses the DDL and the query I have used to get the desired result.
From your description I recommend you create a table for storing user events as follows:
CREATE TABLE t_clickevent (
clickevent_id INTEGER,
user_id INTEGER,
clicked_button_id INTEGER,
redirected_url_id INTEGER);
Add any more columns as and when you require. This is just a minimal structure.
Use the query as follows:
SELECT user_id, clicked_button_id,
redirected_url_id
FROM t_clickevent
GROUP BY user_id, clicked_button_id,
redirected_url_id
HAVING count(*) > 1;
Output:
USER_ID CLICKED_BUTTON_ID REDIRECTED_URL_ID
----------- --------------------- -----------------
1 1 2
1 2 3
Cheers!