Crystal Report charts with strings - vb.net

I'm trying to create a chart in crystal reports that displays count(x) on change of A , B
it's supposed to show number of merchants "count(x)" who paid "B" for each region "A"
the problem is that on Data tab in chart expert, on the available fields, it shows only the numeric fields "e.g: region ID / payers ID" while i want it on change of names not ID
*Note: they're already displayed on the report so it's not a connection/command problem

I tried to check all the types that CR accepts in charts and it were numbers / date / varchar
the fields in my DB was "nVarchar(MAX)" I tried to change it from DB, but CR didn't get affected by this change (God knows why!) and also even if it got affected this will result in other problems , so I thought about changing the type from the CR itself and it really worked
right click on "Formula fields" > New > name your field
then in formula workshop write:
CStr ({table_name.field_name})
while creating your chart, made it on change of the field you've created
I hope it helps as I've made a lot f research and came across many facing the same problem without a working solution

Related

Data tables in Pentaho User Console dashboard don't show numbers correctly

I'm trying to insert a table in a Pentaho User Console dashboard which shows in the first column the name of a company and in the second column how much they have bought in a specified period of time. However, when previsualizing the numbers from the second column they are displayed in the form null + number, like null23456 and then when the table is created NaN is displayed instead of the numbers.
Oddly enough, the table is using the correct number (after the null) and even the order is correct when changing it, it just doesn't show up in the dashboard. It fails for both integers and floating point numbers.
The SQL query I'm using to retrieve the data is the following:
SELECT Nombre AS Empresa, EXTRACT(YEAR FROM F_factura) AS Año, EXTRACT(MONTH FROM F_factura) AS Mes,
EXTRACT(DAY FROM F_factura) AS Día, I_monemp AS Importe
FROM Facturas, Rsocial
WHERE Facturas.rsocial_cod = Rsocial.cod
Import is the number I am trying to display in the second colum.
Data correctly shown on PUC analysis report
Data in previsualizing mode
Data in dashboard
I expect that a numbers like 2865 is shown, instead of null2865 in previsualizing mode and NaN when finished editing. In the end it seems that Pentaho correctly processes the numbers and makes operations like ordering based on them, but it doesn't display said numbers at all. I have no problem working with that data when doing any other task, like creating an Analysis Report, do you know what's happening here?
It looks like the Table Component is applying incorrect formatting to the column.
Check the "Column Formats" property first, there might be a missing comma there.
If that setting is empty, there might be a mistake in Column Types or in one of the extra functions if you have defined any.

Is there a way to use variables in vba to identify MS-Access report fields?

I am not a programmer, but have been tasked with doing this anyway! We are working on a research project that involves testing properties of different samples. I am trying to create a form that will generate a custom report based on what the user chooses. So, I have multiple text boxes and check boxes to allow the user to define the query parameters (e.g. composition of the sample must contain at least 5% component A) and choose what data they are interested in seeing in said report (e.g. show pH, color, but not melting point). I have successfully created code to generate the query, then generate a report based on that query, but the report defaults to column widths that are generally too big (for example, the pH column width is 3 inches, it only needs to be about 1). I would like to be able to fix this, but have not been able to figure out how. At the same time, some of these fields contain numbers that are averages of multiple test results, so I would like to limit the number of digits shown, and display them as % where appropriate. I started with just fixing the column width issue:
I have tried to make a collection of the fields that are included, then loop through the collection and set column widths, but cannot figure out how to identify a field with a variable:
If I know the field name I can do this:
Reports("ReportName")!FieldID.Width = 200
But if I have a collection of names, FieldNames, or a string VariableName, none of these work, giving me an error that FieldNames or VariableName is not a valid field in the report:
Reports("ReportName")!FieldNames(1).Width = 200
Reports("ReportName")![FieldNames(1)].Width = 200
Reports("ReportName")![VariableName].Width = 200
Is there a way to reference a field name with a variable?
Alternatively, I thought there might be a way to loop through all fields and set widths - this would involve looking up a column width for each field, which I thought to do by adding a key to a collection of column widths. But I cannot find a way to do that, something like:
For each Field in Reports("Report")
Field.Width = ColumnWidthCollection(Field)
Next
This hangs up on the Field.Width line, with "invalid procedure call or argument", which brings me back to how to reference a field name with a variable.
Any help would be greatly appreciated!
Try with:
Reports("ReportName")(VariableName).Width = 200

Access Chart based on [long text] fields

I am using Access 2013 and I am trying to create a chart report on one of my reports based on a table. There are about 30 fields in this table. The first field ID is auto number and there is another Customer ID which is set to number, the rest are all "long text" (such as name, review and etc) When I went to the form design and created the chart, at the step which it asked me to choose the fields I need, there were only two available fields - ID and customer ID - available, none of the rest popped up(like the customer name and other stuff)
Is there anything I did wrong? I recall I have made this happen in the old version. And I also realized that there is no pivotchart or table view options in 2013 anymore. Is this because the version thing please/
Thanks, any help and advice will be appreciated.
Do you really need more than 255 Characters for fields such as Customer Name? I think you need to change the datatypes of the fields you would like to include in the chart. Think about a field in a chart that used the max of a long text field.
From the MS Office website "In Access web apps, the Long Text field can store up to 2^30-1 bytes"
My guess is that access does not allow Long Text fields to appear in charts because of the most logic use case for charts, which does not involve the possibility of using a field that is THAT big.
Anyway, try fitting your data in short text fields. If that is too small, then here is a link to increase the size of your short text fields to 4000

How to program crystal report to lookup a record in a table

i Have a Table with Fields
Material Number
Order Code
Supplier Code
Description
I have a crystal reports rpt file that i manually enter all the information to generate labels.
I am trying to program this using the built in formula editor, so when i enter the Material Number (which is a unique code) it will automatically display other 3 relevant fields.
I have tried few formulas in the formula editor without any luck.
can anyone help?
relliK
UPDATE
#Siva - I have added the table for clarification
i simply want a lable printed with only one user input being the Material Number, and then the code/fomula in crystal reports to fetch the other data based on the Materila number and produce the label.
thank you for you interest in this issue.
UPDATE
#Siva - I have added a sample label, i would only want to enter 20506871 as Material and the other data fields to be pulled from excel
not sure if i can use parameter fields and/or i would like some help on programming the parameter fields

Displaying Multiple String Values as separate fields in Crystal Reports

I'm a bit of a noob with crystal reports so be as detailed as possible.
I'm working with two fields in a report, "CRD_NAME", and "CREDIT_CARD_AMOUNT". I can right click the former to browse data and see the credit card types: AMEX, VISA, DISCVR, and MASTER. When I drag this field out to the report, it will only display one value (currently "AMEX").
When I place the Credit_card_amount field under this, it will properly display AMEX totals for that day. Browsing data on this field shows all of the CC totals, and I'm not sure how to associate them with a card type.
What I'm looking to accomplish, is to have CRD_NAME repeated in 4 columns, displaying the different CC types, and the correlating totals under each one. Do I need to create multiple parameters for each field and what I want it to represent?
Any clues would be much appreciated :)
Your best bet might be to create a "Cross Tab" crystal report. When you create a new crystal report, cross tab is one of the options.