SSRS action on field in CSV list - sql-server

My client requires a report that produces a comma separated list of files in one column of a grid. I know I can use a FOR XML Path in my query to yield these results. However, the client wants to be able to click on an individual value in that CSV and be taken to a link for that element in the list. For example, the column in the report would look like:
1.jpg, 2.jpg, 3.jpg
He needs the ability to click on the 2.jpg, and go to that actual file. I know I can put in an action for the entire field to go to one URL, but can I narrow that action down to a specific part of the CSV list?

You can use placeholders to embed hyperlinks in comma delimited text, you'll need to wrap each value with an anchor tag and href. See the URL Embedded in Text section of my earlier answer an example.
SQLFiddle of sample code for adding markup. It's ugly in SQL but works.

I came up with a workable solution. The problem seems to lie in the fact that there are multiple URLs in the list. If i only return a single URL, it works fine. so, instead of a CS list, I return one at a time and use a matrix to group the other fields.

Related

Input field border in other color for NOT NULL fields

I would like to have the input field border in another color if the underlying field is NOT NULL.
After studying the CakePHP documentation I think I can somehow implement it with the Custom Widgets but how do I get the information if the field is NULL or NOT NULL, or does CakePHP already offer something pre-build which I didn't find?
Update:
I display all tables in the edit mode with one script. With this I want to avoid 50 edit.php scripts serving each table in the database. In this one script I generate on the fly the edit form. This means, this script is NEVER assigned to exactly one table. This is not the problem as I can parse all fields and display them properly for every special database type [date, varchar, set, int, time, ...].
Even the field description is read automatically from the table field comment which is then displayed as title tag when the mouse is moved over the ? symbol.
And now, as the next step, I would like to show a different border for a input field which is NOT NULL. This means, the different border should be shown for all fields which are displayed for the table.
I am using CakePHP 4.1.4
I found this solution:
Due to the fact the function has to evaluate the table schema in order to generate on the fly the form, the function knows which fields are NOT NULL. Then, when it creates the field with $this->Form->control(..) it adds simple in the options argument ["style" => "border: color width type"] for these fields, which are NOT NULL..
If somebody has a more elegant way, please post it as an answer so I can learn something and I'll accept it.

Power builder rtf column does not display simple text

I need to convert some datawindow text columns (PB 11.5.1 - SQL Server 2008R2 - datatype Text) to RTF.
I have 2 issues:
New data are displayed fine but the existing data do not display at
all
The RTF format popup has very limited height so the icons are half
displayed
For the first issue I did find a work around but it is far from elegant!
I append this:
{\rtf1\ansi\ansicpg1253\uc1\deff0{\fonttbl {\f0\fswiss\fcharset161\fprq2 Arial;} {\f1\fswiss\fcharset0\fprq2 Tahoma;} {\f2\froman\fcharset2\fprq2 Symbol;}} {\colortbl;\red0\green0\blue0;\red255\green255\blue255;} {\stylesheet{\s0\itap0\nowidctlpar\f0\fs24 [Normal];}{\*\cs10\additive Default Paragraph Font;}} {\*\generator TX_RTF32 13.0.501.502;} \deftab1134\paperw3240\paperh16838\margl0\margt0\margr0\margb0\widowctrl {\*\background{\shp{\*\shpinst\shpleft0\shptop0\shpright0\shpbottom0\shpfhdr0\shpbxmargin\shpbxignore\shpbymargin\shpbyignore\shpwr0\shpwrk0\shpfblwtxt1\shplid1025{\sp{\sn shapeType}{\sv 1}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fillColor}{\sv 12506623}}{\sp{\sn fFilled}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fBackground}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 1}}}}}\pard\itap0\nowidctlpar\plain\f1\fs20
before the text and add a } in the end.
I hope there is another way that does not include changing the actual data!
Any help appreciated
It might be a little cleaner to use the PasteRTF PowerBuilder function for existing data. Technically this doesn't solve your concern about changing data as the function probably adds the RTF tags much like you are doing manually.
As another method that might work is to try using a separate RichTextEdit control and the DataSource function. The DataSource function allows a RichTextEdit control to share data with a DataWindow and display the data in its input fields. If there are input fields in the RichTextEdit control that match the names of columns in the DataWindow, the data in the DataWindow is assigned to those input fields. I'd look at the InputFieldNamesVisible property also because it affects what is displayed.
This example from the Help File establishes the DataWindow control dw_1 as the data source for the RichTextEdit rte_1. Using a template document might be a way around your challenge of displaying data, but not actually changing it- not sure I have not used this myself.
rte_1.DataSource(dw_1)
This example inserts a document called LETTER.RTF into the RichTextEdit rte_letter (the names of the document's input fields match the columns in a DataWindow object d_emp), creates a DataStore, associates it with d_emp, and retrieves data. Then it inserts the document in rte_letter and sets up the DataStore as the data source for rte_1:
DataStore ds_empinfo
ds_empinfo = CREATE DataStore
ds_empinfo.DataObject = "d_emp"
ds_empinfo.SetTransObject(SQLCA)
ds_empinfo.Retrieve()
rte_letter.InsertDocument("LETTER.RTF", TRUE)
rte_letter.DataSource(ds_empinfo)
As far as the icon question - I am not aware of a solution for that.

Customise tabular reports with Bugzilla

I want add more columns to the tabular report.
I am using bugzilla version 4.2.5.
Can you please help with the files that i have to do modification to?
Thanks,
Ramya
if the required field is not there in column list("Change Columns") we have to add the new field by editing the following files.
1)colchange.cgi
2)list/change-columns.html.tmpl
3)field-descs.none.tmpl
All the coloumns of the buglist are directly taken from the DB fields.
For eg:
ID of the buglist page is directly taken from the field bug_id of table bugs.
New fields can be added and arranged the order in which they have to
display in the file colchange.cgi.
Corresponding template file of colchange.cgi is
list/change-columns.html.tmpl.
If we need any modification in the change coloumn page we have to
modify the template file list/change-columns.html.tmpl.
New fields added should be defined in the file field-descs.none.tmpl.
Modify the following files:
1)buglist.cgi
2)colchange.cgi
3)field-descs.none.tmpl
Added the corresponding coloumn to be displayed in the file colchange.cgi and pass the variables to the template file list/list.html.tmpl.
Defined the name that should be displayed in front end in the file
field-descs.none.tmpl.
Modify the file buglist.cgi for the query that should give the
value for the corresponding field
.
There are two ways to do this.
When you display a report, you will find a link at the bottom that says "Change Columns". That's the wasiest way.
If you wan tot change the default columns the edit the following statement in /usr/local/bugzilla-4.2.5/Bugzilla/Constants.pm and add or remove default columns.
use constant DEFAULT_COLUMN_LIST => (
"product", "component", "assigned_to",
"bug_status", "resolution", "short_desc", "changeddate"
);
EDIT: Just realized that this question is two years old. I hope that it helps someone else who stumbles on it.

Recreate a form in CakePHP 1.3 from $this->data?

I've got a Cake application with a reports query interface, where the admin user can filter the data by various inputs in a form and the results are then displayed on the screen. I am looking for the simplest way to add a button which allows the user to download the results of this same query as CSV.
I'm sure I can create one for myself if I have to, but is there already a way to regenerate any given form based on $this->data? That way, I can just add .csv to the form action and use RequestHandler to choose the right output format.
[here take a look at the following...
instead of finding the data from Db you can simply pass $this->data to it.
take a look at follo
Exporting data to CSV the CakePHP way
I guess you have to replicate the function on your controller, one for generating the results on screen and another same function intended for csv, but on the function for csv it must have parameters which are similar to the values of $this->data. Use javascript to redirect on the function for csv.

Adding hyperlinks in sql server

I'm working on storing the body of emails in sql server as ntext. The email body which I'm storing has hyperlinks like "view my website". I want to represent this normal text as hypelink?
Any Ideas?
You can insert the text as a normal insert. You may want to consider using something like FCKEditor to allow your users to format the email properly unless your going to be able to control how the HTML is created. You will want to make sure your columns datatype and size are appropriate.
Not knowing your table schema here is a very basic example.
Insert into Emailtable
('emailHtml', 'emailText')
Values
('<HTML><Head></Head><Body>view my website</Body></HTML>', 'Text version of the email')
If your going to have spaces and special characters in your link you could HTML encode the link so when it stores it and retrieves it you know your getting the right values.
You can store the text as formatted HTML and when you sent it with your email client (not sure how you will be sending these) set the client to send the message as HTML formatted. Then it's just a matter of adding the tags to the NText.
the sql type named text is appropriated for html content(including hyperlinks).
In your page you shoud use HtmlString class to show htm content.

Resources