I have a table [List_Models] which has 3 fields
PK - Model_ID (num)
Model_Name (txt)
Picture (attachment)
A certain model has plenty of colour combinations (one has 52) and so 52 pictures attached.
On my report, however, I simply want to attach first (or any) of those pictures, as long as it is a correct model.
Basically no matter colour combination, simply show a picture so it is easier to visualise the model itself.
How do I go about this in the easiest way?
I have made a query to fetch first picture from the attachment (ie. 2 columns, Model_ID, Picture.FileData). Here is the syntax:
SELECT Zoznam_Modelov.Model_ID, Zoznam_Modelov.Picture.FileData
FROM (SELECT Zoznam_Modelov.Model_ID, Max(Zoznam_Modelov.Picture) AS MaxzPicture FROM Zoznam_Modelov WHERE (((Zoznam_Modelov.model_id) Is Not Null)) GROUP BY Zoznam_Modelov.Model_ID) AS U_Pic
INNER JOIN Zoznam_Modelov ON U_Pic.Model_ID = Zoznam_Modelov.Model_ID
WHERE (((Zoznam_Modelov.Picture.FileName)=U_Pic.[MaxzPicture]));
Then I tried attaching the FileData to the report in this way:
Make Attachment field in Form
Set Control Source as:
=DLookUp("Zoznam_Modelov.Picture.FileData";"qryUnique_Pictures_Data";"Model_ID = " & [Model_ID])
However, it remains blank.
How do I go about this in the easiest way?
Just open the report in Design View, then drag and drop the Attachment field onto the report. That will add an Attachment control that is bound to the Attachment field. The default settings will display the first attachment (picture) on the report like this:
Related
I've created a bar chart in Qlik dashboard. Using inline load I've added static data to filters(Listbox) of my dashboard. It is unavoidable so have taken static data for filters.
Based on the item selected in filters(ListBox) by user I'm creating a dynamic dimension on qlik bar chart using actual fields from the data source. but when I click on any bar its not filtering all associated data of dashboard and even bar chart is also not filtering accordingly.
Can you please suggest any workaround for this.
Thanks
You could try to split the data source column into something you could use for filtering. I'll assume that the column coming from the Data Source is named ProductCode. In the LOAD script you'll have something like :
LOAD
...
ProductCode,
...
You could try to add two new columns like this :
LOAD
...
ProductCode,
Left(ProductCode, 2) as ProductCodePrefix,
Right(ProductCode, 1) as ProductCodeSuffix,
...
Could this help?
Background:
I am creating an app that stores record of trainings that employees in a company took in table. I want to filter the rows of the table based on training name and/or employee name. I was able to figure out this first part, and I was able to create a button that clears all the filters and reloads the entire table using the clearFilters() function.
Problem:
I want to create two buttons that clear the filter selections one ("All Trainings") for the training name and one ("All Employees") for the employee name. To be more clear, when I click on the "All Trainings" button, I want to clear the filters on the training name, but not on the Employee name. This will become useful once I have a table with multiple fields that I want to filter, and I want to navigate the table without having to reset all fields every time.
I tried searching the functions available on Google App Maker, but there was nothing that seemed to be able to solve my problem. Any suggestions?
From the Reference about datasources:
https://developers.google.com/appmaker/models/datasources#query_datasources
Like field filters, assigning null to a relation filter property clears that restriction.
So, something like:
datasource.query.filters.Employee._contains = null;
datasource.load();
should work for you.
I am sure there is a better way to do this, so you may want to wait for someone smarter to chime in, but I BELIEVE you can just have your button clear the filters, but reapply a new filter.
So for my situation I have the table do a filter for items that are listed as "Complete", so those are hidden when the user opens the page.
Then, when the users filter another field and want to clear out that search I didn't want the "Complete" items to reappear (which is what happened when I just used the clearFilters() function. So my workaround was to make the clear button actually clear the filter, but apply the original "Complete" filter.
So for my OnClick action, for my "Clear Button" I have:
widget.datasource.query.clearFilters();
widget.datasource.load();
app.closeDialog();
var datasource = app.datasources.TestModel;
datasource.query.filters.Status._notContains = 'Complete';
datasource.load();
The
widget.datasource.load();
app.closeDialog();
May be redundant/unnecessary.
Can you simply take 3 steps in your onClick handler?
(1) clear all filter
(2) set the employee name filter
(3) load data
When I make a query in BusinessObjects and when two tables are inner-joined, the BO generates the following script:
SELECT
attr_1,... attr_N
FROM Table_1, Table_2
WHERE Table_1.key = Table_2.key
Is it possible to set BusinessObjets to generate queries in the following format:
SELECT
attr_1,..., attr_N
FROM Table_1
INNER JOIN
Table_2
ON Table_1.key = Table_2.key
When I want to check the query, it is much more easy to read the syntax in the second example.
Btw, I tried to modify some parameters. However, it didn't work.
Any suggestion on how to do it quickly and easily?
Assuming you're on XI3...
In Designer, go to File -> Parameters. Then click the Parameter tab. In there you should see a parameter named "ANSI92"; change its value to Yes and click Replace.
In BI4 IDT, first open the universe's Data Foundation. Then click on the .dfx file in the Data Foundation pane to select it:
This will bring up the Data Foundation settings in the lower right corner of the window. Click the Properties tab, then the Parameters button:
In the dialog that comes up, you can change the ANSI92 option:
I have a VBScript that I use to read an XML file and populate a couple of tables in Access 2010. The VBScript also copies jpg files from a card reader to a location on the server. The VBScript creates a unique folder based on date/time...the folder location of each image name is written to the database as one of the fields in UNC path\filename.jpg notation.
I have a primary database and the transaction (images) are referenced in the second database. I have created a relationship as well...
I am able to build my report in Access from data from both the tables, however, I'd like to automate a print job that grabs the last entry to the primary database, it's associated images (up to 10...but not 10 in every case) and print them out. When I try to build the report I cannot figure out how to use a query result of the field with the filenames to display on the report.
You can do what you describe using an Image control and a line of VBA code. For a sample table named [ImageLocations]
ImageLocation
-----------------------------------
\\SERVER\Public\Pictures\image1.jpg
\\SERVER\Public\Pictures\image2.jpg
I created a report with that table as the Record Source, dropped the [ImageLocation] field onto the Detail band, and added an Image control. I used the following as the On Format event of the report's Detail section:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.ImageControl.Picture = Me.ImageLocation.Value
End Sub
When I print the report I see the images associated with the filenames in the table.
Edit re: comment
Newer versions of Access (since at least Access 2010) do not need the On Format VBA code. We can simply place an Image control on the report and set its Control Source property to the (text) field containing the path to the image file. Thanks to Albert D. Kallal for the tip!
I am trying to create a form in access that has a dropdown at the top and will populate the rest of the form with the record that corresponds to what is chosen.
I have looked at 2 different guides online but both point to older versions of Access and I think I am missing something.
So. The order that I did everything:
I went to the table for the form. And I clicked Form. This made a quick form with all of the fields as text boxes.
I deleted the field that will be the dropdown and I put in a dropdown canceling the wizard
In the data section for the dropdown. I edited "Row Source" to select the field that will be in the dropdown and the unique ID, in that order.
I set the bound Column to 2 (I have tried both)
I set the name of the Combo Box to "TitleSelector"
In Form Settings. For "Record Source". I have "[forms]![Edit Piece].[TitleSelector] & "*" in Criteria for "ID". I also have the rest of the fields in the Query listed
I added the "me.requery" to on change
Not sure if it means anything. When I was typing in the Criteria for "ID" it did not show "TitleSelector" in the drop down.
I am using Access 2010
Edit:
My Problem -
The dropdown itself shows everything correctly. However nothing happens when I choose something
Edit:
SELECT Pieces.ID, Pieces.Title, Pieces.Composer, Pieces.Instrumentation, Pieces.Location, Pieces.Location_2
FROM Pieces
WHERE (((Pieces.ID)=[forms]![Edit Piece].[TitleSelector]));
Edit:
Here is a link to a copy of my database: https://www.dropbox.com/s/tpnqm686tj653fg/Trisha%20Database.accdb
Adding the me.requery to the ON CHANGE EVENT
(select CODE BUILDER - and enter the me.requery there) should work.
I have downloaded the sample file. Your problem is that the Record Source for the [Edit Piece] form is set to...
SELECT Pieces.ID, Pieces.Title, Pieces.Composer, Pieces.Instrumentation, Pieces.Location, Pieces.Location_2 FROM Pieces WHERE (((Pieces.ID)=[forms]![Edit Piece].[TitleSelector] & "*"));
...and the & "*" at the very end is causing the query to return no records. Removing that last bit so the Form's Record Source is...
SELECT Pieces.ID, Pieces.Title, Pieces.Composer, Pieces.Instrumentation, Pieces.Location, Pieces.Location_2 FROM Pieces WHERE (((Pieces.ID)=[forms]![Edit Piece].[TitleSelector]));
...gets your form working.
Edit
To have your form display information from the related tables (instead of just the foreign key values from the [Pieces] table), change the Record Source of the Form from...
SELECT Pieces.ID, Pieces.Title, Pieces.Composer, Pieces.Instrumentation, Pieces.Location, Pieces.Location_2 FROM Pieces WHERE (((Pieces.ID)=[forms]![Edit Piece].[TitleSelector]));
...to...
SELECT Pieces.ID, Pieces.Title, Composer.Composer, Instrumentation.Instrumentation, Location.Location, Location_1.Location AS Location_2 FROM (Location INNER JOIN (Instrumentation INNER JOIN (Composer INNER JOIN Pieces ON Composer.ID = Pieces.Composer) ON Instrumentation.ID = Pieces.Instrumentation) ON Location.ID = Pieces.Location) INNER JOIN Location AS Location_1 ON Pieces.Location_2 = Location_1.ID WHERE (((Pieces.ID)=[forms]![Edit Piece].[TitleSelector]));